
package handling.channel.handler;


import client.*;
import client.anticheat.CheatingOffense;
import client.inventory.*;
import client.skills.*;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import com.alibaba.druid.pool.DruidPooledConnection;
import configs.FishingConfig;
import configs.ServerConfig;
import constants.*;
import database.DatabaseConnection;
import handling.channel.ChannelServer;
import handling.opcode.EffectOpcode;
import handling.opcode.RecvPacketOpcode;
import handling.opcode.VCoreOpcode;
import handling.world.PlayerBuffStorage;
import handling.world.party.MapleParty;
import handling.world.party.MaplePartyCharacter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import scripting.npc.NPCScriptManager;
import server.*;
import server.Timer;
import server.life.MapleMonster;
import server.maps.*;
import server.movement.LifeMovementFragment;
import server.quest.MapleQuest;
import server.reward.StarReward;
import server.skill.MapleForceAtom;
import server.skill.MapleForceAtomFactory;
import tools.*;
import tools.data.input.LittleEndianAccessor;
import tools.packet.*;

import java.awt.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
















































 public class PlayerHandler {
    /*   51 */   private static final Logger log = LogManager.getLogger(PlayerHandler.class);



    public static void ChangeSkillMacro(LittleEndianAccessor slea, MapleCharacter chr) {
        /*   54 */
        int num = slea.readByte();




        /*   59 */
        for (int i = 0; i < num; i++) {
            /*   60 */
            String name = slea.readMapleAsciiString();
            /*   61 */
            int shout = slea.readByte();
            /*   62 */
            int skill1 = slea.readInt();
            /*   63 */
            int skill2 = slea.readInt();
            /*   64 */
            int skill3 = slea.readInt();
            /*   65 */
            SkillMacro macro = new SkillMacro(skill1, skill2, skill3, name, shout, i);
            /*   66 */
            chr.updateMacros(i, macro);

        }

    }



    public static void ChangeKeymap(LittleEndianAccessor slea, MapleCharacter chr) {
        /*   71 */
        if (slea.available() > 8L && chr != null) {
            /*   72 */
            slea.skip(4);
            /*   73 */
            int numChanges = slea.readInt();
            /*   74 */
            for (int i = 0; i < numChanges; i++) {
                /*   75 */
                int key = slea.readInt();
                /*   76 */
                byte type = slea.readByte();
                /*   77 */
                int action = slea.readInt();
                /*   78 */
                if (type == 1 && action >= 1000) {
                    /*   79 */
                    Skill skil = SkillFactory.getSkill(action);
                    /*   80 */
                    if (skil != null && ((
                            /*   81 */             !SkillConstants.isFourthJob(skil.getId()) && !skil.isBeginnerSkill() && skil.isInvisible() && chr.getSkillLevel(skil) <= 0) || SkillConstants.isLinkedAttackSkill(action))) {

                        continue;

                    }

                }

                /*   86 */
                chr.changeKeybinding(key, type, action);
                continue;

            }
            /*   88 */
        } else if (chr != null) {
            /*   89 */
            int type = slea.readInt(), data = slea.readInt();
            /*   90 */
            switch (type) {

                case 1:
                    /*   92 */
                    if (data <= 0) {
                        /*   93 */
                        chr.getQuestRemove(MapleQuest.getInstance(122221));
                        break;

                    }
                    /*   95 */
                    chr.getQuestNAdd(MapleQuest.getInstance(122221)).setCustomData(String.valueOf(data));

                    break;


                case 2:
                    /*   99 */
                    if (data <= 0) {
                        /*  100 */
                        chr.getQuestRemove(MapleQuest.getInstance(122223));
                        break;

                    }
                    /*  102 */
                    chr.getQuestNAdd(MapleQuest.getInstance(122223)).setCustomData(String.valueOf(data));

                    break;


                case 3:
                    /*  106 */
                    if (data <= 0) {
                        /*  107 */
                        chr.getQuestRemove(MapleQuest.getInstance(122224));
                        break;

                    }
                    /*  109 */
                    chr.getQuestNAdd(MapleQuest.getInstance(122224)).setCustomData(String.valueOf(data));

                    break;

            }

        }

    }






















































    public static void UseChair(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /*  167 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /*  170 */
        slea.skip(4);
        /*  171 */
        int itemId = slea.readInt();
        /*  172 */
        int slot = slea.readInt();
        /*  173 */
        slea.skip(1);
        /*  174 */
        Point point = slea.readPosAsInt();
        /*  175 */
        String msg = "";

        /*  177 */
        long meso = 0L;



        /*  181 */
        int mode_ = 0;
        /*  182 */
        byte unkMask_1 = 0;
        /*  183 */
        byte unkMask_2 = 0;
        /*  184 */
        byte unkMask_3 = 0;
        /*  185 */
        byte unkMask_4 = 0;
        /*  186 */
        byte unkMask_5 = 0;




        /*  191 */
        int mode = 0;
        /*  192 */
        byte unkMask1 = 0;
        /*  193 */
        byte unkMask2 = 0;
        /*  194 */
        byte unkMask3 = 0;
        /*  195 */
        byte unkMask4 = 0;
        /*  196 */
        byte unkMask5 = 0;


        /*  199 */
        if (itemId / 1000 == 3014) {
            /*  200 */
            msg = slea.readMapleAsciiString();

        } else {
            /*  202 */
            switch (itemId) {

                case 3015440:

                case 3015650:

                case 3015651:

                case 3015897:
                    /*  207 */
                    meso = slea.readLong();

                    break;


                default:
                    /*  211 */
                    mode_ = slea.readInt();
                    /*  212 */
                    unkMask_1 = slea.readByte();
                    /*  213 */
                    unkMask_2 = slea.readByte();
                    /*  214 */
                    unkMask_3 = slea.readByte();
                    /*  215 */
                    unkMask_4 = slea.readByte();
                    /*  216 */
                    unkMask_5 = slea.readByte();

                    break;

            }



        }
        /*  222 */
        mode = slea.readInt();

        /*  224 */
        unkMask1 = slea.readByte();
        /*  225 */
        unkMask2 = slea.readByte();
        /*  226 */
        unkMask3 = slea.readByte();
        /*  227 */
        unkMask4 = slea.readByte();
        /*  228 */
        unkMask5 = slea.readByte();



        /*  232 */
        Item toUse = chr.getInventory(MapleInventoryType.SETUP).getItem((short) slot);
        /*  233 */
        if (toUse == null && itemId != 3010587) {
            /*  234 */
            chr.getCheatTracker().registerOffense(CheatingOffense.USING_UNAVAILABLE_ITEM, Integer.toString(itemId));


            return;

        }
        /*  238 */
        if (GameConstants.isFishingMap(chr.getMapId()) && (
                /*  239 */       !FishingConfig.FISHING_CHECK_CHAIR || itemId == FishingConfig.FISHING_CHAIR)) {
            /*  240 */
            if ((chr.getStat()).canFish) {
                /*  241 */
                chr.startFishingTask();

            } else {
                /*  243 */
                chr.dropMessage("你没有鱼竿，无法开始钓鱼。");

            }

        }


        /*  248 */
        int[] unkMaskList = {unkMask1, unkMask2, unkMask3, unkMask4, unkMask5};

        /*  250 */
        chr.setChairMsg(msg);
        /*  251 */
        chr.setChairMeso(meso);
        /*  252 */
        chr.setChair(itemId);
        /*  253 */
        chr.setChairMode(mode);
        /*  254 */
        chr.setChairMask(unkMaskList);



        /*  258 */
        c.announce(MaplePacketCreator.UseChairUnk(0));

        /*  260 */
        chr.getMap().broadcastMessage(chr, MaplePacketCreator.showChair(chr, false), false);


        /*  263 */
        if (meso > 0L) {
            /*  264 */
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.addChairMeso(itemId, 999), false);

        }
        /*  266 */
        c.announce(MaplePacketCreator.enableActions());

    }





















    public static void CancelChair(short id, MapleClient c, MapleCharacter chr) {
        /*  288 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /*  291 */
        if (id == -1) {




            /*  296 */
            chr.cancelFishingTask();
            /*  297 */
            chr.setChair(0);
            /*  298 */
            chr.setChairType(0);
            /*  299 */
            chr.setChairMsg("");
            /*  300 */
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.showChair(chr, true), false);

        } else {

            /*  303 */
            chr.setChair(id);

        }
        /*  305 */
        c.announce(MaplePacketCreator.cancelChair(chr.getId(), id));

    }






    public static void TrockAddMap(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /*  312 */
        byte type = slea.readByte();
        /*  313 */
        byte vip = slea.readByte();
        /*  314 */
        if (type == 0) {
            /*  315 */
            int mapId = slea.readInt();
            /*  316 */
            if (vip == 1) {
                /*  317 */
                chr.deleteFromRegRocks(mapId);
                /*  318 */
            } else if (vip == 2) {
                /*  319 */
                chr.deleteFromRocks(mapId);
                /*  320 */
            } else if (vip == 3) {
                /*  321 */
                chr.deleteFromHyperRocks(mapId);

            }
            /*  323 */
            c.announce(MTSCSPacket.INSTANCE.getTrockRefresh(chr, vip, true));
            /*  324 */
        } else if (type == 1) {
            /*  325 */
            if (!FieldLimitType.VipRock.check(chr.getMap().getFieldLimit())) {
                /*  326 */
                if (vip == 1) {
                    /*  327 */
                    chr.addRegRockMap();
                    /*  328 */
                } else if (vip == 2) {
                    /*  329 */
                    chr.addRockMap();
                    /*  330 */
                } else if (vip == 3) {
                    /*  331 */
                    chr.addHyperRockMap();

                }
                /*  333 */
                c.announce(MTSCSPacket.INSTANCE.getTrockRefresh(chr, vip, false));

            } else {
                /*  335 */
                chr.dropMessage(1, "你可能没有保存此地图.");

            }

        }

    }


    public static void CharInfoRequest(int objectid, MapleClient c, MapleCharacter chr) {

        MapleCharacter player;
        /*  341 */
        if (chr == null || chr.getMap() == null) {

            return;

        }

        /*  345 */
        if (objectid == 0) {
            /*  346 */
            player = chr.getMap().getCharacterById(chr.getId());

        } else {
            /*  348 */
            player = chr.getMap().getCharacterById(objectid);

        }
        /*  350 */
        c.announce(MaplePacketCreator.enableActions());
        /*  351 */
        if (player != null && (
                /*  352 */       !player.isGM() || chr.isGM())) {
            /*  353 */
            c.announce(MaplePacketCreator.charInfo(player, (chr.getId() == objectid)));

        }

    }




    public static void AranCombo(MapleClient c, MapleCharacter chr, int toAdd) {
        /*  359 */
        if (chr != null && JobConstants.is战神(chr.getJob()))
             {
            /*  361 */
            if (toAdd > 0) {
                /*  362 */
                int combo = chr.getAranCombo() + toAdd;
                /*  363 */
                if (combo >= 1000) {
                    /*  364 */
                    chr.setAranCombo(500, true);
                    /*  365 */
                    int skilllevel = chr.getSkillLevel(21110016);
                    /*  366 */
                    if (skilllevel > 0) {
                        /*  367 */
                        SkillFactory.getSkill(21110016).getEffect(skilllevel).applyTo(chr);

                    }

                } else {
                    /*  370 */
                    chr.setAranCombo(combo, true);

                }

            } else {
                /*  373 */
                chr.gainAranCombo(toAdd, true);

            }

        }

    }






    public static void UseItemEffect(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /*  382 */
        int itemId = slea.readInt();
        /*  383 */
        int itemType = slea.readInt();
        /*  384 */
        if (itemId == 0) {
            /*  385 */
            chr.setItemEffect(0);
            /*  386 */
            chr.setItemEffectType(0);

        } else {
            /*  388 */
            Item toUse = chr.getInventory(MapleInventoryType.CASH).findById(itemId);
            /*  389 */
            if (toUse == null || toUse.getItemId() != itemId || toUse.getQuantity() < 1) {
                /*  390 */
                c.announce(MaplePacketCreator.enableActions());

                return;

            }
            /*  393 */
            if (itemId != 5510000) {
                /*  394 */
                chr.setItemEffect(itemId);
                /*  395 */
                chr.setItemEffectType(itemType);

            }

        }
        /*  398 */
        chr.getMap().broadcastMessage(chr, MaplePacketCreator.itemEffect(chr.getId(), itemId, itemType), false);

    }






    public static void UseTitleEffect(int itemId, MapleClient c, MapleCharacter chr) {
        /*  405 */
        if (itemId == 0) {
            /*  406 */
            chr.setTitleEffect(0);
            /*  407 */
            chr.getQuestRemove(MapleQuest.getInstance(124000));

        } else {
            /*  409 */
            Item toUse = chr.getInventory(MapleInventoryType.SETUP).findById(itemId);
            /*  410 */
            if (toUse == null || toUse.getItemId() != itemId || toUse.getQuantity() < 1) {
                /*  411 */
                c.announce(MaplePacketCreator.enableActions());

                return;

            }
            /*  414 */
            if (itemId / 10000 == 370) {
                /*  415 */
                chr.setTitleEffect(itemId);
                /*  416 */
                chr.getQuestNAdd(MapleQuest.getInstance(124000)).setCustomData(String.valueOf(itemId));

            }

        }
        /*  419 */
        chr.getMap().broadcastMessage(chr, MaplePacketCreator.showTitleEffect(chr.getId(), itemId), false);

    }



    public static void CancelItemEffect(int id, MapleCharacter chr) {
        /*  423 */
        chr.cancelEffect(MapleItemInformationProvider.getInstance().getItemEffect(-id), false, -1L);

    }



    public static void CancelBuffHandler(int sourceid, MapleCharacter chr) {
        /*  427 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /*  430 */
        Skill skill = SkillFactory.getSkill(sourceid);
        /*  431 */
        int totalSkillLevel = chr.getTotalSkillLevel(skill);
        /*  432 */
        if (chr.isShowPacket()) {
            /*  433 */
            chr.dropDebugMessage(1, "[BUFF信息] 客户端取消技能BUFF 技能ID:" + sourceid + " 技能名字:" + SkillFactory.getSkillName(sourceid));

        }

        /*  436 */
        if (skill == null) {

            return;

        }
        /*  439 */
        if (skill.isRapidAttack() || skill.isChargingSkill() || skill.isChargeSkill()) {
            /*  440 */
            chr.setKeyDownSkill_Time(0L);
            /*  441 */
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.skillCancel(chr, sourceid), false);

            /*  443 */
            skill.getEffect(totalSkillLevel).applyCoolTime(chr, System.currentTimeMillis(), true);

        } else {
            /*  445 */
            chr.getClient().announce(MaplePacketCreator.skillCancel(chr, sourceid));

        }

        /*  448 */
        if (skill.getEffect(totalSkillLevel).getStatups() != null) {
            /*  449 */
            chr.cancelEffect(skill.getEffect(1), false, -1L);

        }
        /*  451 */
        if (sourceid == 27101202 || sourceid == 400011068) {
            /*  452 */
            chr.send(BuffPacket.cancelBuff(Collections.singletonList(MapleBuffStat.SECONDARY_STAT_KeyDownAreaMoving), chr));
            /*  453 */
            chr.send_other(BuffPacket.cancelForeignBuff(chr, Collections.singletonList(MapleBuffStat.SECONDARY_STAT_KeyDownAreaMoving)), false);

        }
        /*  455 */
        if (sourceid == 400041009) {
            /*  456 */
            int[] arrn = {400041011, 400041012, 400041013, 400041014, 400041015};
            /*  457 */
            Optional.<Skill>ofNullable(SkillFactory.getSkill(arrn[Randomizer.nextInt(arrn.length)])).ifPresent(skill1 -> skill1.getEffect(totalSkillLevel).applyTo(chr, true));

        }

    }






    public static void CancelMech(LittleEndianAccessor slea, MapleCharacter chr) {
        /*  465 */
        if (chr == null) {

            return;

        }
        /*  468 */
        if (slea.available() > 1L) {
            /*  469 */
            int sourceid = slea.readInt();
            /*  470 */
            if (sourceid % 10000 < 1000 && SkillFactory.getSkill(sourceid) == null) {
                /*  471 */
                sourceid += 1000;

            }
            /*  473 */
            Skill skill = SkillFactory.getSkill(sourceid);
            /*  474 */
            if (skill == null) {

                return;

            }
            /*  477 */
            if (sourceid == 32111016) {

                return;

            }
            /*  480 */
            if (skill.isChargeSkill()) {
                /*  481 */
                chr.setKeyDownSkill_Time(0L);
                /*  482 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.skillCancel(chr, sourceid), false);

            } else {
                /*  484 */
                chr.cancelEffect(skill.getEffect(slea.readByte()), false, -1L);

            }

        }

    }



    public static void QuickSlot(LittleEndianAccessor slea, MapleCharacter chr) {
        /*  490 */
        if (chr == null) {

            return;

        }
        /*  493 */
        chr.getQuickSlot().resetQuickSlot();
        /*  494 */
        for (int i = 0; i < 32; i++) {
            /*  495 */
            chr.getQuickSlot().addQuickSlot(i, slea.readInt());

        }

    }



    public static void PassiveskillInfoUpdate(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /*  500 */
        if (player == null) {

            return;

        }
        /*  503 */
        int tick = slea.readInt();
        /*  504 */
        slea.readShort();
        /*  505 */
        slea.readInt();


        /*  508 */
        Pair<Integer, Integer> summond = player.getStat().updateSummondSkillID();
        /*  509 */
        if (((Integer) summond.getLeft()).intValue() > 0) {
            /*  510 */
            Skill skill = SkillFactory.getSkill(((Integer) summond.getLeft()).intValue());
            /*  511 */
            if (skill != null) {
                /*  512 */
                MapleStatEffect effect = skill.getEffect(1);
                /*  513 */
                if (effect != null) {
                    /*  514 */
                    if (((Integer) summond.getRight()).intValue() > 0) {
                        /*  515 */
                        effect.applyTo(player, null, true);

                        return;

                    }
                    /*  518 */
                    player.dispelSkill(((Integer) summond.getLeft()).intValue());
                    /*  519 */
                    int n3 = SkillConstants.eE(((Integer) summond.getLeft()).intValue());
                    /*  520 */
                    if (n3 > 0) {
                        /*  521 */
                        player.dispelSkill(n3);

                    }

                }

            }

        }

    }



    public static void SkillEffect(LittleEndianAccessor slea, MapleCharacter chr) {
        /*  529 */
        int skillId = slea.readInt();
        /*  530 */
        if (skillId == 0) {

            return;

        }
        /*  533 */
        byte level = slea.readByte();
        /*  534 */
        byte display = slea.readByte();
        /*  535 */
        if (skillId == 400021072) {
            /*  536 */
            slea.readInt();

        }
        /*  538 */
        byte direction = slea.readByte();
        /*  539 */
        byte speed = slea.readByte();
        /*  540 */
        Point position = null;
        /*  541 */
        if (slea.available() >= 4L) {
            /*  542 */
            position = slea.readPos();

        }

        /*  545 */
        Skill skill = SkillFactory.getSkill(SkillConstants.getLinkedAttackSkill(skillId));
        /*  546 */
        if (chr == null || skill == null || chr.getMap() == null) {

            return;

        }
        /*  549 */
        if (skill.isRapidAttack() || skill.isChargingSkill()) {
            /*  550 */
            chr.setKeyDownSkill_Time(System.currentTimeMillis());
            /*  551 */
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.skillEffect(chr.getId(), skillId, level, display, direction, speed, position), false);

        }

        /*  554 */
        if (skillId == 155121341 || skillId == 155111306 || skillId == 400051334)
             {
            /*  556 */
            if (chr.getBuffedValue(MapleBuffStat.幽灵侵蚀) == null) {
                /*  557 */
                SkillFactory.getSkill(155000007).getEffect(chr.getSkillLevel(155000007)).applyTo(chr, true);

            }

        }

        /*  561 */
        MapleStatEffect effect = skill.getEffect(chr.getTotalSkillLevel(skillId));
        /*  562 */
        switch (skillId) {

            case 400041006:
                /*  564 */
                effect.applyCoolTime(chr, System.currentTimeMillis(), false);

                break;

            case 400041009:
                /*  567 */
                chr.handle无敌(effect, 6000);

                break;

            case 400051040:
                /*  570 */
                effect.applyTo(chr, false);

                break;

        }

    }




















































    public static void specialAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /*  625 */
        if (chr == null || chr.getMap() == null) {
            /*  626 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /*  629 */
        int pos_x = slea.readInt();
        /*  630 */
        int pos_y = slea.readInt();

        /*  632 */
        slea.skip(4);
        /*  633 */
        slea.skip(4);
        /*  634 */
        int display = slea.readInt();
        /*  635 */
        int skillId = slea.readInt();
        /*  636 */
        slea.skip(4);
        /*  637 */
        boolean isLeft = (slea.readByte() > 0);
        /*  638 */
        int speed = slea.readInt();
        /*  639 */
        int tickCount = slea.readInt();
        /*  640 */
        Skill skill = SkillFactory.getSkill(SkillConstants.getLinkedAttackSkill(skillId));
        /*  641 */
        int skilllevel = chr.getTotalSkillLevel(skill);
        /*  642 */
        if (skill == null || skilllevel <= 0) {
            /*  643 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }
        /*  647 */
        MapleStatEffect effect = skill.getEffect(chr.getTotalSkillLevel(skill));
        /*  648 */
        if ((skillId == 400031003 || skillId == 400031004) && !ServerConfig.WORLD_SKILL_400031003) {

            return;

        }
        /*  651 */
        effect.applyTo(chr);
        /*  652 */
        effect.applyCoolTime(chr, System.currentTimeMillis(), false);
        /*  653 */
        chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, skillId, 1, chr.getLevel(), skilllevel), false);
        /*  654 */
        chr.getMap().broadcastMessage(chr, MaplePacketCreator.showSpecialAttack(chr.getId(), tickCount, pos_x, pos_y, display, skillId, skilllevel, isLeft, speed), chr.getTruePosition());
    }

    public static void SpecialMove(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {

        byte number_of_mobs;
        int i, mobID;
        MapleMonster mob;
        byte mobsize;
        ArrayList<Integer> moblist;
        byte b10;
        MapleForce 火焰释放实例;
        Rectangle rectangle1;
        int k;
        byte b1;
        int newskill[], j;
        Rectangle rectangle;
        Point pointLift;
        Map<Integer, Point> wreckagesMap;
        int mobCount=0;
        MapleSummon summon;
        int posx, attackCount;
        MapleSummon summonBySkillID2, summonBySkillID4;
        byte size;
        List<MapleMapObject> list4;
        byte b3;
        List<Integer> list3;
        List<MapleMonster> list;
        List<Integer> list2;
        List<MapleMapObject> mapObjectsInRect;
        Point pointRigth;
        ArrayList<Integer> toMobOIDs;
        List<Integer> list1;
        int posy;
        byte b2;
        MapleSummon summonBySkillID3;
        List<Integer> moboids;
        ArrayList<Integer> mobList;
        Rectangle bounds;
        MapleForce mapleForce1;
        MapleStatEffect finalEffect;
        MapleForce force;
        ArrayList<Integer> arrayList;
        MapleSummon summonBySkillIDLife;
        List<MapleMapObject> mapObjectsInRange;
        List<Integer> mode, list6;
        Point point3;
        int n;
        List<MapleBlueSkySword> list5;
        int m;
        List<MapleBlueSkySword> Sword;
        MapleForceType ForceType;
        List<MapleMapObject> affected;
        int i2;
        MapleForce mapleForce;
        MapleSummon summonBySkillIDRigth;
        int i1, width[], arrayOfInt1[], skillsid;
        List<Integer> list7;
        int angle[], arrayOfInt2[], i4, i3;
        Point point1;

        int count;

        MapleForce mapleForce2;

        Point[] poss;

        int i5, i6;
        /*  659 */
        if (chr == null || chr.hasBlockedInventory() || chr.getMap() == null || slea.available() < 9L) {
            /*  660 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /*  663 */
        Point position = slea.readPos();
        /*  664 */
        int skillid = slea.readInt();

        /*  666 */
        if (ServerConfig.WORLD_BANALLSKILL) {
            /*  667 */
            chr.dropMessage(5, "管理员禁止了技能施放.");
            /*  668 */
            c.sendEnableActions();


            return;

        }
        /*  672 */
        if (SkillFactory.isBlockedSkill(skillid)) {
            /*  673 */
            chr.dropMessage(5, "由于<" + SkillFactory.getSkillName(skillid) + ">技能数据异常,暂未开放使用.");
            /*  674 */
            c.sendEnableActions();


            return;

        }
        /*  678 */
        switch (skillid) {

            case 23111008:
                /*  680 */
                skillid += Randomizer.nextInt(3);

                break;

            case 5210015:
                /*  683 */
                skillid += Randomizer.nextInt(4);

                break;

        }

        /*  687 */
        if (JobConstants.is神之子(chr.getJob()) && skillid >= 100000000) {
            /*  688 */
            slea.readByte();

        }
        /*  690 */
        int skillLevel = slea.readInt();
        /*  691 */
        slea.skip(4);
        /*  692 */
        byte unk = slea.readByte();



        /*  696 */
        if (unk > 0) {
            /*  697 */
            slea.readInt();

        }
        /*  699 */
        slea.skip(4);
        /*  700 */
        Skill skill = SkillFactory.getSkill(skillid);
        /*  701 */
        if (skill == null || (SkillConstants.is天使祝福戒指(skillid) && (chr.getStat()).equippedSummon % 10000 != skillid % 10000) || (chr.inPVP() && skill.isPVPDisabled())) {
            /*  702 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /*  705 */
        if (chr.checkSoulWeapon() && skill.getId() == chr.getEquippedSoulSkill()) {
            /*  706 */
            chr.checkSoulState(true);

        }
        /*  708 */
        int checkSkilllevel = chr.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(skillid));
        /*  709 */
        if (chr.isShowPacket()) {
            /*  710 */
            chr.dropDebugMessage(1, "[BUFF信息] 技能ID: " + skillid + " 技能等级: " + skillLevel);
            /*  711 */
            if (SkillConstants.getLinkedAttackSkill(skillid) != skillid && !skill.isInvisible()) {
                /*  712 */
                chr.dropDebugMessage(1, "[BUFF信息] 连接技能ID: " + SkillConstants.getLinkedAttackSkill(skillid) + " 连接技能等级: " + checkSkilllevel);

            }

        }
        /*  715 */
        if ((checkSkilllevel <= 0 || checkSkilllevel != skillLevel) && !skill.isInvisible()) {
            /*  716 */
            if (!SkillConstants.isMulungSkill(skillid) && !SkillConstants.isPyramidSkill(skillid) && checkSkilllevel <= 0) {
                /*  717 */
                if (chr.isShowPacket()) {
                    /*  718 */
                    chr.dropDebugMessage(3, "[BUFF信息] 使用技能出现异常 技能ID: " + skillid + " 角色技能等级: " + checkSkilllevel + " 封包获取等级: " + skillLevel + " 是否相同: " + ((checkSkilllevel == skillLevel) ? 1 : 0));

                }
                /*  720 */
                Skill.log.error("玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skillid + " 技能等级: " + checkSkilllevel + " - " + (!SkillConstants.isMulungSkill(skillid) ? 1 : 0) + " - " + (!SkillConstants.isPyramidSkill(skillid) ? 1 : 0) + " 封包:" + slea.toString(true));
                /*  721 */
                c.announce(MaplePacketCreator.enableActions());

                return;

            }
            /*  724 */
            if (SkillConstants.isMulungSkill(skillid)) {
                /*  725 */
                if (chr.getMapId() / 10000 != 92502) {

                    return;

                }

                /*  729 */
                if (chr.getMulungEnergy() < 10000) {

                    return;

                }
                /*  732 */
                chr.mulung_EnergyModify(false);

            }
            /*  734 */
            else if (SkillConstants.isPyramidSkill(skillid) &&
                    /*  735 */         chr.getMapId() / 10000 != 92602 && chr.getMapId() / 10000 != 92601) {

                return;

            }

        }


        /*  741 */
        skillLevel = chr.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(skillid));
        /*  742 */
        MapleStatEffect effect = chr.inPVP() ? skill.getPVPEffect(skillLevel) : skill.getEffect(skillLevel);

        /*  744 */
        if (skillid != 35111002 && !DamageParse.applyAttackCooldown(effect, chr, skillid, false, true, false)) {

            return;

        }

        /*  748 */
        if (effect.getDuration() <= 0 && (chr.hasBuffSkill(skillid) || chr.hasBuffSkill(SkillConstants.getLinkedAttackSkill(skillid)))) {
            /*  749 */
            c.announce(MaplePacketCreator.enableActions());
            /*  750 */
            chr.cancelEffect(effect, false, -1L);

            return;

        }
        /*  753 */
        MapleForceAtomFactory forceinstance = MapleForceAtomFactory.INSTANCE;

        /*  755 */
        switch (skillid) {

            case 9001020:

            case 9101020:

            case 31111003:
                /*  759 */
                number_of_mobs = slea.readByte();
                /*  760 */
                slea.skip(3);
                /*  761 */
                for (i = 0; i < number_of_mobs; i++) {
                    /*  762 */
                    int mobId = slea.readInt();
                    /*  763 */
                    MapleMonster mapleMonster = chr.getMap().getMonsterByOid(mobId);
                    /*  764 */
                    if (mapleMonster != null) {

                        /*  766 */
                        mapleMonster.switchController(chr, mapleMonster.isControllerHasAggro());
                        /*  767 */
                        mapleMonster.applyStatus(chr, new MonsterStatusEffect(MonsterStatus.MOB_STAT_Stun, Integer.valueOf(1), skillid, null, false, 0), false, effect.getDuration(), true, effect);

                    }

                }
                /*  770 */
                chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, skillid, EffectOpcode.UserEffect_SkillUse.getValue(), chr.getLevel(), skillLevel, slea.readByte()), chr.getTruePosition());
                /*  771 */
                c.announce(MaplePacketCreator.enableActions());

                break;

            case 30001061:
                /*  774 */
                mobID = slea.readInt();
                /*  775 */
                mob = chr.getMap().getMonsterByOid(mobID);
                /*  776 */
                if (mob != null) {
                    /*  777 */
                    boolean success = (mob.getHp() <= mob.getMobMaxHp() / 2L && mob.getId() >= 9304000 && mob.getId() < 9305000);
                    /*  778 */
                    chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, skillid, EffectOpcode.UserEffect_SkillUse.getValue(), chr.getLevel(), skillLevel, (byte) (success ? 1 : 0)), chr.getTruePosition());
                    /*  779 */
                    if (success) {
                        /*  780 */
                        chr.getQuestNAdd(MapleQuest.getInstance(111112)).setCustomData(String.valueOf((mob.getId() % 10 + 1) * 10));
                        /*  781 */
                        chr.getMap().killMonster(mob, chr, true, false, (byte) 1);
                        /*  782 */
                        chr.cancelEffectFromBuffStat(MapleBuffStat.骑兽技能);
                        /*  783 */
                        c.announce(MobPacket.showResults(mobID, true));
                        /*  784 */
                        c.announce(MaplePacketCreator.updateJaguar(chr));

                    } else {
                        /*  786 */
                        chr.dropMessage(5, "怪物体力过高，捕抓失败。");
                        /*  787 */
                        c.announce(MobPacket.showResults(mobID, false));

                    }

                }
                /*  790 */
                c.announce(MaplePacketCreator.enableActions());

                break;

            case 30001062:
                /*  793 */
                chr.dropMessage(5, "没有能被召唤的怪物，请先捕抓怪物。");
                /*  794 */
                c.announce(MaplePacketCreator.enableActions());

                break;

            case 27121054:
                /*  797 */
                chr.handleLuminous(skillid);

                break;

            case 20040219:

            case 20040220:

            case 20041239:
                /*  802 */
                chr.dropMessage(5, "当前暂不支持该功能.");
                /*  803 */
                c.announce(MaplePacketCreator.enableActions());

                break;

            case 12101025:
                /*  806 */
                chr.handle火焰传动();
                /*  807 */
                c.announce(MaplePacketCreator.flameMark(12101025));

                break;

            case 400041021:
                /*  810 */
                c.announce(MaplePacketCreator.flameMark(400041021));

                break;

            case 400021044:
                /*  813 */
                mobsize = slea.readByte();
                /*  814 */
                moblist = new ArrayList<>();
                /*  815 */
                for (b10 = 0; b10 < mobsize; b10 = (byte) (b10 + 1)) {
                    /*  816 */
                    moblist.add(Integer.valueOf(slea.readInt()));

                }

                /*  819 */
                火焰释放实例 = new MapleForce(chr.getId(), 400021045, 0, MapleForceType.火焰释放, (byte) 1, moblist, (byte) 1, effect.getZ(), chr.getMap(), effect.getBulletCount());
                /*  820 */
                chr.send_other(ForcePacket.showForce(火焰释放实例, chr.getPosition()), true);
                /*  821 */
                c.announce(MaplePacketCreator.enableActions());

                break;

            case 400041022:
                /*  824 */
                if (skillid == 400041022) {
                    /*  825 */
                    chr.getSpecialStat().setStackCount(0);

                }

                /*  828 */
                rectangle1 = effect.calculateBoundingBox(chr.getOldPosition(), chr.isFacingLeft());

                /*  830 */
                list4 = chr.getMap().getMonstersInRect(rectangle1);

                /*  832 */
                mobList = new ArrayList<>();

                /*  834 */
                list4.forEach(y2 -> mobList.add(Integer.valueOf(y2.getObjectId())));


                /*  837 */
                ForceType = MapleForceType.黑杰克;

                /*  839 */
                skillsid = 400041023;

                /*  841 */
                i4 = (skillid == 400041022) ? effect.getV() : effect.getX();

                /*  843 */
                mapleForce2 = new MapleForce(chr.getId(), skillsid, 0, ForceType, (byte) 1, mobList, (byte) 1, i4, chr.getMap(), effect.getBulletCount());

                /*  845 */
                chr.getMap().broadcastMessage(ForcePacket.showForce(mapleForce2, chr.getPosition()));
                /*  846 */
                c.getSession().write(MaplePacketCreator.enableActions());

                break;








            case 65111100:
                /*  856 */
                k = effect.getBulletCount();
                /*  857 */
                slea.readInt();
                /*  858 */
                b3 = slea.readByte();










                /*  869 */
                bounds = effect.calculateBoundingBox(chr.getTruePosition(), chr.isFacingLeft());
                /*  870 */
                affected = chr.getMap().getMapObjectsInRect(bounds, Collections.singletonList(MapleMapObjectType.MONSTER));
                /*  871 */
                list7 = new ArrayList<>();
                /*  872 */
                if (affected.isEmpty()) {

                    return;

                }

                /*  876 */
                for (i3 = 0; i3 < k; i3++) {
                    /*  877 */
                    list7.add(Integer.valueOf(((MapleMapObject) affected.get(Randomizer.nextInt(affected.size()))).getObjectId()));

                }

                /*  880 */
                chr.getSpecialStat().gainForceCounter();
                /*  881 */
                c.announce(ForcePacket.灵魂吸取精髓(chr.getId(), 65111007, chr.getSpecialStat().getForceCounter(), list7, k));
                /*  882 */
                chr.getSpecialStat().gainForceCounter(b3);

                /*  884 */
                effect.applyTo(chr);

                break;


            case 4341003:
                /*  888 */
                chr.setKeyDownSkill_Time(0L);
                /*  889 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.skillCancel(chr, skillid), false);

                break;


            case 31221001:

            case 35101002:

            case 35110017:
                /*  895 */
                if (skillid == 31221001) {
                    /*  896 */
                    slea.skip(4);

                }
///*  898 */         b1 = slea.readByte();
///*  899 */         list3 = (List<Integer>) IntStream.range(0, b1).mapToObj(i -> Integer.valueOf(slea.readInt())).collect(Collectors.toList());
                b1 = slea.readByte();
                list3 = (List) IntStream.range(0, mobCount).mapToObj((ix) -> {
                    return slea.readInt();
                }).collect(Collectors.toList());

                /*  900 */
                if (skillid == 31221001) {
                    /*  901 */
                    int delay = slea.readShort();
                    /*  902 */
                    chr.getMap().broadcastMessage(ForcePacket.ShieldChacing(chr.getId(), list3, 31221014, effect.getBulletCount(chr), delay), chr.getTruePosition());
                    /*  903 */
                } else if (list3.size() == b1) {
                    /*  904 */
                    int count_ex = 0;
                    /*  905 */
                    int skilllevel_link = chr.getTotalSkillLevel(35120017);
                    /*  906 */
                    if (skilllevel_link > 0) {
                        /*  907 */
                        Optional<Skill> skill1 = Optional.ofNullable(SkillFactory.getSkill(35120017));
                        /*  908 */
                        if (skill1.isPresent()) {
                            /*  909 */
                            count_ex = ((Skill) skill1.get()).getEffect(skilllevel_link).getBulletCount();

                        }

                    }
                    /*  912 */
                    chr.getMap().broadcastMessage(ForcePacket.showForce(new MapleForce(chr.getId(), skillid, 0, MapleForceType.辅助导弹, (byte) 1, list3, (byte) 0, effect.getBulletCount() + count_ex, chr.getMap(), effect.getMobCount())));

                }
                /*  914 */
                c.announce(MaplePacketCreator.enableActions());

                break;



            case 400031000:
                /*  919 */
                chr.getMap().broadcastMessage(ForcePacket.向导之箭(chr.getId(), skillid));
                /*  920 */
                effect.applyTo(chr);

                break;







            case 13101022:
                /*  929 */
                newskill = new int[]{13120003, 13110022, 13101022};
                /*  930 */
                for (int i7 : newskill) {
                    /*  931 */
                    if (chr.getSkillLevel(i7) > 0) {
                        /*  932 */
                        Optional.<Skill>ofNullable(SkillFactory.getSkill(i7)).ifPresent(skill1 -> skill1.getEffect(chr.getTotalSkillLevel(i7)).applyTo(chr));

                        break;

                    }

                }
                /*  936 */
                c.announce(MaplePacketCreator.enableActions());

                break;









            case 25100009:

            case 25120110:
                /*  948 */
                j = slea.readByte();
                /*  949 */
                list3 = IntStream.range(0, j).mapToObj(ix -> slea.readInt()).collect(Collectors.toList());
                /*  950 */
                mapleForce1 = new MapleForce(chr.getObjectId(), (skillid == 25100009) ? 25100010 : 25120115, 0, MapleForceType.灵狐, (byte) 1, list3, (skillid == 25100009) ? (byte) 1 : (byte) 2, 1, chr.getMap(), effect.getBulletCount());
                /*  951 */
                chr.send(ForcePacket.showForce(mapleForce1));

                break;


            case 2221011:
                /*  955 */
                j = slea.readByte();
                /*  956 */
                list = (List<MapleMonster>) IntStream.range(0, j).mapToObj(ix -> chr.getMap().getMonsterByOid(slea.readInt())).collect(Collectors.toList());
                /*  957 */
                finalEffect = effect;
                /*  958 */
                list.parallelStream().filter(Objects::nonNull).forEach(e -> e.applyNewStatus(finalEffect));
                /*  959 */
                chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr, skillid, 1, chr.getLevel(), skillLevel), chr.getTruePosition());
                /*  960 */
                if (!chr.hasBuffSkill(skillid)) {
                    /*  961 */
                    finalEffect.applyTo(chr);

                }

                break;


            case 2121052:
                /*  966 */
                j = slea.readByte();
                /*  967 */
                list2 = (List<Integer>) IntStream.range(0, j).mapToObj(ix -> Integer.valueOf(slea.readInt())).collect(Collectors.toList());
                /*  968 */
                force = new MapleForce(chr.getObjectId(), 2121055, 0, MapleForceType.追击盾_审判之焰, (byte) 1, list2, (byte) 2, effect.getBulletCount(), chr.getMap(), effect.getBulletCount());
                /*  969 */
                chr.send(ForcePacket.showForce(force));

                break;


            case 400021001:
                /*  973 */
                chr.getSpecialStat().setStackCount(0);

                /*  975 */
                rectangle = MapleStatEffectFactory.calculateBoundingBox(effect, chr.getOldPosition(), chr.isFacingLeft());
                /*  976 */
                mapObjectsInRect = chr.getMap().getMapObjectsInRect(rectangle, Collections.singletonList(MapleMapObjectType.MONSTER));
                /*  977 */
                arrayList = new ArrayList<>();

                /*  979 */
                i2 = 0;
                /*  980 */
                for (MapleMapObject mmo : mapObjectsInRect) {
                    /*  981 */
                    if (i2 == 15) {

                        break;

                    }
                    /*  984 */
                    i2++;
                    /*  985 */
                    arrayList.add(Integer.valueOf(mmo.getObjectId()));

                }
                /*  987 */
                if (!arrayList.isEmpty()) {
                    /*  988 */
                    MapleForce mapleForce3 = new MapleForce(chr.getId(), skillid, 0, MapleForceType.制裁火球, (byte) 1, arrayList, (byte) 1, effect.getX(), chr.getMap(), effect.getBulletCount());
                    /*  989 */
                    chr.send_other(ForcePacket.showForce(mapleForce3, chr.getPosition()), true);
                    /*  990 */
                    c.sendEnableActions();
                    break;

                }
                /*  992 */
                c.sendEnableActions();

                break;




            case 400031022:
                /*  998 */
                rectangle = effect.calculateBoundingBox(chr.getOldPosition(), chr.isFacingLeft());
                /*  999 */
                mapObjectsInRect = chr.getMap().getMapObjectsInRect(rectangle, Collections.singletonList(MapleMapObjectType.MONSTER));
                /* 1000 */
                arrayList = new ArrayList<>();
                /* 1001 */
                mapObjectsInRect.forEach(y2 -> arrayList.add(Integer.valueOf(y2.getObjectId())));
                /* 1002 */
                mapleForce = new MapleForce(chr.getId(), skillid, 0, MapleForceType.懒虫, (byte) 1, arrayList, (byte) 1, effect.getAttackCount(), chr.getMap(), effect.getX());
                /* 1003 */
                chr.send_other(ForcePacket.showForce(mapleForce, chr.getPosition()), true);
                /* 1004 */
                c.announce(MaplePacketCreator.enableActions());

                break;


            case 400051017:
                /* 1008 */
                rectangle = effect.calculateBoundingBox(chr.getOldPosition(), chr.isFacingLeft());
                /* 1009 */
                mapObjectsInRect = chr.getMap().getMapObjectsInRect(rectangle, Collections.singletonList(MapleMapObjectType.MONSTER));
                /* 1010 */
                arrayList = new ArrayList<>();
                /* 1011 */
                mapObjectsInRect.forEach(y2 -> arrayList.add(Integer.valueOf(y2.getObjectId())));

                /* 1013 */
                mapleForce = new MapleForce(chr.getId(), skillid, 0, MapleForceType.微型导弹箱, (byte) 1, arrayList, (byte) 1, effect.getBulletCount(), chr.getMap(), effect.getBulletCount());
                /* 1014 */
                chr.send_other(ForcePacket.showForce(mapleForce, chr.getPosition()), true);
                /* 1015 */
                effect.applyTo(chr, chr.getPosition());
                /* 1016 */
                c.announce(MaplePacketCreator.enableActions());

                break;



            case 400021017:
                /* 1021 */
                SkillFactory.getSkill(400021018).getEffect(chr.getSkillLevel(400021018)).applyTo(chr);

                break;


            case 42111103:
                /* 1025 */
                SkillFactory.getSkill(42111101).getEffect(chr.getSkillLevel(42111101)).applyTo(chr);
                /* 1026 */
                SkillFactory.getSkill(42111102).getEffect(chr.getSkillLevel(42111102)).applyTo(chr);

                /* 1028 */
                pointLift = new Point((chr.getPosition()).x + (chr.isFacingLeft() ? -600 : 600), (chr.getPosition()).y);
                /* 1029 */
                pointRigth = new Point((chr.getPosition()).x + (chr.isFacingLeft() ? 600 : -600), (chr.getPosition()).y);
                /* 1030 */
                summonBySkillIDLife = chr.getSummonBySkillID(42111101);
                /* 1031 */
                summonBySkillIDRigth = chr.getSummonBySkillID(42111102);

                /* 1033 */
                if (summonBySkillIDLife != null) {
                    /* 1034 */
                    c.announce(SummonPacket.SummonedForceMove(summonBySkillIDLife, 42111100, chr.getSkillLevel(42111100), pointLift));

                }
                /* 1036 */
                if (summonBySkillIDRigth != null) {
                    /* 1037 */
                    c.announce(SummonPacket.SummonedForceMove(summonBySkillIDRigth, 42111100, chr.getSkillLevel(42111100), pointRigth));

                }

                break;



            case 400031014:
                /* 1043 */
                chr.getSkillEffect(33001001).applyTo(chr);

                break;


            case 400031012:
                /* 1047 */
                c.announce(MaplePacketCreator.LP_UserBonusAttackRequest(400031012, 0, Collections.EMPTY_LIST));
                /* 1048 */
                c.announce(MaplePacketCreator.LP_UserBonusAttackRequest(400031013, 0, Collections.EMPTY_LIST));



            case 22141017:

            case 22170070:
                /* 1053 */
                wreckagesMap = chr.getWreckagesMap();
                /* 1054 */
                toMobOIDs = new ArrayList<>();
                /* 1055 */
                mapObjectsInRange = chr.getMap().getMapObjectsInRange(chr.getPosition(), 250000.0D, Collections.singletonList(MapleMapObjectType.MONSTER));
                /* 1056 */
                for (MapleMapObject object : mapObjectsInRange) {
                    /* 1057 */
                    toMobOIDs.add(Integer.valueOf(object.getObjectId()));
                    /* 1058 */
                    if (toMobOIDs.size() >= effect.getMobCount()) {

                        break;

                    }

                }
                /* 1062 */
                if (!wreckagesMap.isEmpty() && !toMobOIDs.isEmpty()) {
                    /* 1063 */
                    ArrayList<Point> points = new ArrayList<>(wreckagesMap.values());
                    /* 1064 */
                    MapleForceAtom forceAtom = new MapleForceAtom();
                    /* 1065 */
                    forceAtom.setOwnerID(chr.getId());
                    /* 1066 */
                    forceAtom.setType(23);
                    /* 1067 */
                    forceAtom.setToMobOID(0);
                    /* 1068 */
                    forceAtom.setToMobOIDs(toMobOIDs);
                    /* 1069 */
                    forceAtom.setSkillID(effect.getSourceid());
                    /* 1070 */
                    forceAtom.setForceAtomEntry(forceinstance.createForceList(chr, effect, points, 512));
                    /* 1071 */
                    chr.getMap().broadcastMessage(chr, forceAtom.getPacket(), true);
                    /* 1072 */
                    chr.getMap().broadcastMessage(chr, MaplePacketCreator.removeWreckages(chr.getId(), new ArrayList(wreckagesMap.keySet())), true);

                }

                break;







            case 155101006:
                /* 1082 */
                if (chr.getBuffedValue(MapleBuffStat.控制侵蚀) != null) {
                    /* 1083 */
                    chr.cancelEffectFromBuffStat(MapleBuffStat.控制侵蚀);
                    /* 1084 */
                    c.announce(MaplePacketCreator.enableActions());

                    break;

                }
                /* 1087 */
                SkillFactory.getSkill(155101006).getEffect(chr.getSkillLevel(155101006)).applyTo(chr);

                break;



            case 155001103:
                /* 1092 */
                slea.skip(4);

                /* 1094 */
                mobCount = slea.readInt();

                /* 1096 */
                list1 = new ArrayList<>();

                /* 1098 */
                mode = new ArrayList<>();

                /* 1100 */
                for (i1 = 0; i1 < mobCount; i1++) {
                    /* 1101 */
                    list1.add(Integer.valueOf(slea.readInt()));

                }


                /* 1105 */
                if (chr.getSpecialStat().getNZ1() > 0) {
                    /* 1106 */
                    SkillFactory.getSkill(155001001).getEffect(chr.getSkillLevel(155001001)).applyTo(chr);
                    /* 1107 */
                    chr.ResetAllNz(1);
                    /* 1108 */
                    mode.add(Integer.valueOf(43));

                }
                /* 1110 */
                if (chr.getSpecialStat().getNZ2() > 0) {
                    /* 1111 */
                    SkillFactory.getSkill(155101003).getEffect(chr.getSkillLevel(155101003)).applyTo(chr);
                    /* 1112 */
                    chr.ResetAllNz(2);
                    /* 1113 */
                    mode.add(Integer.valueOf(44));

                }
                /* 1115 */
                if (chr.getSpecialStat().getNZ3() > 0) {
                    /* 1116 */
                    SkillFactory.getSkill(155111005).getEffect(chr.getSkillLevel(155111005)).applyTo(chr);
                    /* 1117 */
                    chr.ResetAllNz(3);
                    /* 1118 */
                    mode.add(Integer.valueOf(45));

                }
                /* 1120 */
                if (chr.getSpecialStat().getNZ4() > 0) {
                    /* 1121 */
                    SkillFactory.getSkill(155121005).getEffect(chr.getSkillLevel(155121005)).applyTo(chr);
                    /* 1122 */
                    chr.ResetAllNz(4);
                    /* 1123 */
                    mode.add(Integer.valueOf(46));

                }


                /* 1127 */
                chr.send_other(MaplePacketCreator.UserNlzdRequest(chr, list1, mode), true);

                /* 1129 */
                chr.getSpecialStat().setTotalnz(5);

                /* 1131 */
                mode.removeAll(mode);

                break;




            case 1311014:

            case 400011054:
                /* 1138 */
                summon = chr.getSummonBySkill(1301013);

                /* 1140 */
                if (summon == null) {

                    return;

                }

                /* 1144 */
                c.announce(SummonPacket.SoulPowerShocked(chr, summon.getObjectId(), skillid));
                /* 1145 */
                effect.applyTo(chr, false);

                break;



            case 400011089:
                /* 1150 */
                summon = chr.getSummonBySkill(400011088);

                /* 1152 */
                if (summon == null) {

                    return;

                }

                /* 1156 */
                chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));

                /* 1158 */
                chr.getMap().removeMapObject((MapleMapObject) summon);
                /* 1159 */
                chr.removeVisibleMapObject((MapleMapObject) summon);
                /* 1160 */
                chr.removeSummon(summon);

                /* 1162 */
                effect.applyTo(chr, false);

                break;


            case 400041041:
                /* 1166 */
                slea.readByte();
                /* 1167 */
                posx = slea.readInt();
                /* 1168 */
                posy = slea.readInt();
                /* 1169 */
                slea.readByte();
                /* 1170 */
                slea.readInt();
                /* 1171 */
                slea.readInt();
                /* 1172 */
                effect.applyTo(chr, new Point(posx, posy));

                break;


            case 3011004:

            case 3300002:

            case 3321003:
                /* 1178 */
                attackCount = effect.getAttackCount();
                /* 1179 */
                slea.skip(4);
                /* 1180 */
                b2 = slea.readByte();

                /* 1182 */
                chr.handle追加星爆(skillid);
                /* 1183 */
                chr.handle更新纹样(skillid);
                /* 1184 */
                list6 = (List<Integer>) IntStream.range(0, b2).mapToObj(ix -> Integer.valueOf(slea.readInt())).collect(Collectors.toList());
                /* 1185 */
                if (!list6.isEmpty()) {
                    /* 1186 */
                    chr.getSpecialStat().gainForceCounter();
                    /* 1187 */
                    chr.getClient().getSession().write(ForcePacket.暗红释魂(chr.getId(), skillid, chr.getSpecialStat().getForceCounter(), list6, attackCount));
                    /* 1188 */
                    chr.getSpecialStat().gainForceCounter(1);

                }

                break;


            case 3311002:

            case 3321006:

            case 400031038:
                /* 1195 */
                chr.handle更新纹样(skillid);

                break;




























            case 400011010:
                /* 1225 */
                if (chr.getBuffedValue(MapleBuffStat.恶魔狂怒) != null) {
                    /* 1226 */
                    chr.addCooldown(effect);

                }

                break;


            case 152001001:

            case 152110004:

            case 152120001:
                /* 1233 */
                chr.getMap().broadcastMessage(chr, forceinstance.createForceAtom(chr, effect, Collections.singletonList(Integer.valueOf(0))).getPacket(), true);

                break;


            case 152101003:
                /* 1237 */
                summonBySkillID2 = chr.getSummonBySkillID(152101000);
                /* 1238 */
                summonBySkillID3 = chr.getSummonBySkillID(152101008);
                /* 1239 */
                point3 = new Point((chr.getPosition()).x + (chr.isFacingLeft() ? -360 : 360), (chr.getPosition()).y);
                /* 1240 */
                if (summonBySkillID2 != null) {
                    /* 1241 */
                    c.announce(SummonPacket.SummonedForceMove(summonBySkillID2, 152101003, chr.getSkillLevel(152101003), point3));

                }
                /* 1243 */
                if (summonBySkillID3 != null) {
                    /* 1244 */
                    c.announce(SummonPacket.SummonedForceMove(summonBySkillID3, 152101008, chr.getSkillLevel(152101008), point3));

                }

                break;




            case 152121005:
                /* 1251 */
                if ((summonBySkillID4 = chr.getSummonBySkillID(152101000)) != null) {
                    /* 1252 */
                    summonBySkillID4.setState(2, 0);
                    /* 1253 */
                    c.announce(SummonPacket.SummonedCrossTheStyx(summonBySkillID4, 2));

                }

                break;



            case 151001001:
                /* 1259 */
                size = slea.readByte();
                /* 1260 */
                moboids = new ArrayList<>();
                /* 1261 */
                for (n = 0; n < size; n++) {
                    /* 1262 */
                    moboids.add(Integer.valueOf(slea.readInt()));

                }
                /* 1264 */
                list5 = new ArrayList<>();
                /* 1265 */
                width = new int[]{0, 120, 120, 240, 240};
                /* 1266 */
                angle = new int[]{0, -15, 15, -30, 30};
                /* 1267 */
                point1 = chr.getPosition();
                /* 1268 */
                poss = new Point[]{new Point(point1.x, point1.y - 120), new Point(point1.x - 40, point1.y - 100), new Point(point1.x + 40, point1.y - 100), new Point(point1.x - 80, point1.y - 80), new Point(point1.x + 80, point1.y - 80)};
                /* 1269 */
                for (i6 = 0; i6 < 5; i6++) {
                    /* 1270 */
                    list5.add(new MapleBlueSkySword(chr, 1 + i6, 0, moboids.isEmpty() ? 0 : ((Integer) moboids.get(Randomizer.nextInt(moboids.size()))).intValue(), width[i6], 600, angle[i6], skillid, 2400, 1, poss[i6]));

                }
                /* 1272 */
                chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list5, 0));

                break;


            case 151101006:
                /* 1276 */
                if (!chr.hasBuffSkill(skillid)) {
                    /* 1277 */
                    List<MapleBlueSkySword> list8 = new ArrayList<>();

                    /* 1279 */
                    if (!chr.getSpecialStat().isDZ1() && chr.getSpecialStat().getCKZZ() >= 100) {
                        /* 1280 */
                        for (int i7 = 0; i7 < 2; i7++) {
                            /* 1281 */
                            list8.add(new MapleBlueSkySword(chr, 6 + i7, 1 + i7, 0, 0, 0, 0, chr.getJob(), 0, 1, chr.getPosition()));

                        }
                        /* 1283 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        /* 1284 */
                        chr.getSpecialStat().setDZ1(true);

                    }

                    /* 1287 */
                    if (!chr.getSpecialStat().isDZ2() && chr.getSpecialStat().getCKZZ() >= 200) {
                        /* 1288 */
                        for (int i7 = 0; i7 < 2; i7++) {
                            /* 1289 */
                            list8.add(new MapleBlueSkySword(chr, 8 + i7, 3 + i7, 0, 0, 0, 0, chr.getJob(), 0, 1, chr.getPosition()));

                        }
                        /* 1291 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        /* 1292 */
                        chr.getSpecialStat().setDZ2(true);

                    }

                    /* 1295 */
                    if (chr.getJob() == 15112 && !chr.getSpecialStat().isDZ3() && chr.getSpecialStat().getCKZZ() >= 300) {
                        /* 1296 */
                        for (int i7 = 0; i7 < 2; i7++) {
                            /* 1297 */
                            list8.add(new MapleBlueSkySword(chr, 10 + i7, 5 + i7, 0, 0, 0, 0, chr.getJob(), 0, 1, chr.getPosition()));

                        }
                        /* 1299 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        /* 1300 */
                        chr.getSpecialStat().setDZ3(true);

                    }


                    break;

                }
                /* 1305 */
                if (chr.getSpecialStat().isDZ1()) {
                    /* 1306 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, 6));
                    /* 1307 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, 7));
                    /* 1308 */
                    chr.getSpecialStat().setDZ1(false);

                }

                /* 1311 */
                if (chr.getSpecialStat().isDZ2()) {
                    /* 1312 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, 8));
                    /* 1313 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, 9));
                    /* 1314 */
                    chr.getSpecialStat().setDZ2(false);

                }

                /* 1317 */
                if (chr.getJob() == 15112 && chr.getSpecialStat().isDZ3()) {
                    /* 1318 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, 10));
                    /* 1319 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, 11));
                    /* 1320 */
                    chr.getSpecialStat().setDZ3(false);

                }

                /* 1323 */
                chr.getSpecialStat().setYJZZ(0);

                break;



            case 151111003:
                /* 1328 */
                if (chr.hasBuffSkill(151101006)) {

                    /* 1330 */
                    List<MapleBlueSkySword> list8 = new ArrayList<>();
                    /* 1331 */
                    List<Integer> unksize = new ArrayList<>();
                    /* 1332 */
                    unksize.add(Integer.valueOf(165));
                    /* 1333 */
                    unksize.add(Integer.valueOf(135));
                    /* 1334 */
                    unksize.add(Integer.valueOf(150));
                    /* 1335 */
                    int[] value = {-165, 165};


                    /* 1338 */
                    byte b = slea.readByte();
                    /* 1339 */
                    int i7 = (chr.getPosition()).y;
                    /* 1340 */
                    List<Integer> list9 = new ArrayList<>();
                    int i8;
                    /* 1341 */
                    for (i8 = 0; i8 < b; i8++) {
                        /* 1342 */
                        list9.add(Integer.valueOf(slea.readInt()));

                    }

                    /* 1345 */
                    chr.gainCKZZ(-effect.getS());

                    /* 1347 */
                    if (chr.hasBuffSkill(400011109) && chr.getSpecialStat().getYJZZ() >= 8) {

                        /* 1349 */
                        for (i8 = 0; i8 < 2; i8++) {
                            /* 1350 */
                            list8.add(new MapleBlueSkySword(chr, 12 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                        }
                        /* 1352 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        break;
                        /* 1353 */
                    }
                    if (chr.getJob() == 15112 && chr.getSpecialStat().getYJZZ() >= 6) {
                        /* 1354 */
                        if (chr.hasBuffSkill(400011109)) {
                            /* 1355 */
                            chr.getSpecialStat().gainYJZZ(2);
                            /* 1356 */
                            for (i8 = 0; i8 < 2; i8++) {
                                /* 1357 */
                                list8.add(new MapleBlueSkySword(chr, 18 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                            }
                            /* 1359 */
                            chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));

                            break;

                        }
                        /* 1362 */
                        for (i8 = 0; i8 < 2; i8++) {
                            /* 1363 */
                            list8.add(new MapleBlueSkySword(chr, 12 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                        }
                        /* 1365 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        break;

                    }
                    /* 1367 */
                    if (chr.getSpecialStat().getYJZZ() >= 4) {

                        /* 1369 */
                        if (chr.getJob() == 15112) {
                            /* 1370 */
                            chr.getSpecialStat().gainYJZZ(2);
                            /* 1371 */
                            for (i8 = 0; i8 < 2; i8++) {
                                /* 1372 */
                                list8.add(new MapleBlueSkySword(chr, 16 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                            }
                            /* 1374 */
                            chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));

                            break;

                        }
                        /* 1377 */
                        for (i8 = 0; i8 < 2; i8++) {
                            /* 1378 */
                            list8.add(new MapleBlueSkySword(chr, 12 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                        }
                        /* 1380 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        break;

                    }
                    /* 1382 */
                    if (chr.getSpecialStat().getYJZZ() >= 2) {
                        /* 1383 */
                        chr.getSpecialStat().gainYJZZ(2);
                        /* 1384 */
                        for (i8 = 0; i8 < 2; i8++) {
                            /* 1385 */
                            list8.add(new MapleBlueSkySword(chr, 14 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                        }
                        /* 1387 */
                        chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));
                        break;

                    }
                    /* 1389 */
                    chr.getSpecialStat().gainYJZZ(2);

                    /* 1391 */
                    for (i8 = 0; i8 < 2; i8++) {
                        /* 1392 */
                        list8.add(new MapleBlueSkySword(chr, 12 + i8, 7, list9.isEmpty() ? 0 : ((Integer) list9.get(Randomizer.nextInt(list9.size()))).intValue(), new Point(i7, i7), value[i8], unksize));

                    }
                    /* 1394 */
                    chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), list8, 0));

                }

                break;




            case 400011108:
                /* 1401 */
                size = slea.readByte();
                /* 1402 */
                moboids = new ArrayList<>();
                /* 1403 */
                for (m = 0; m < size; m++) {
                    /* 1404 */
                    moboids.add(Integer.valueOf(slea.readInt()));

                }
                /* 1406 */
                Sword = new ArrayList<>();
                /* 1407 */
                arrayOfInt1 = new int[]{-198, 167, 193, -295, 604, 268, -345, 9, 277, 288, 433, 324, 256, 65, 6, -51, 111, 33, -244, 549};
                /* 1408 */
                arrayOfInt2 = new int[]{-85, 23, 85, 68, -133, -149, 103, -86, -62, -166, 134, -146, 153, 135, -111, -145, -73, 114, -76, 131};
                /* 1409 */
                count = (effect.getBulletCount() >= 20) ? effect.getBulletCount() : 20;
                /* 1410 */
                for (i5 = 0; i5 < count; i5++)
                     {


                    /* 1414 */
                    Sword.add(new MapleBlueSkySword(chr, chr.getMap().getSpawnedSwordOnMap(), 8, moboids.isEmpty() ? 0 : ((Integer) moboids.get(Randomizer.nextInt(moboids.size()))).intValue(), 0, 1320, 0, skillid, 31000, 65, new Point(arrayOfInt1[i5], arrayOfInt2[i5])));

                }
                /* 1416 */
                chr.getMap().broadcastMessage(MapleBlueSkySwordPacket.SpawnBlueSkySword(chr.getId(), Sword, 1));

                break;

        }






        /* 1425 */
        Point pos = null;
        /* 1426 */
        int direction = -1;
        /* 1427 */
        if (skillid == 400021030) {
            /* 1428 */
            Point pos1 = slea.readPos();
            /* 1429 */
            slea.readByte();
            /* 1430 */
            int num = slea.readInt();
            /* 1431 */
            for (int i7 = 0; i7 < num; i7++) {
                /* 1432 */
                Point posMist = slea.readPosAsInt();
                /* 1433 */
                Timer.MapTimer.getInstance().schedule(() -> chr.getMap().spawnMist(new MapleMist(chr.getSkillEffect(400021031).calculateBoundingBox(posMist, chr.isFacingLeft()), chr, chr.getSkillEffect(400021031), posMist), 200, false), (i7 * 400));

            }




            /* 1439 */
            c.announce(MaplePacketCreator.enableActions());



            return;

        }

        /* 1445 */
        if (skillid == 35111002) {
            /* 1446 */
            int type = slea.readByte();
            /* 1447 */
            if (type == 2) {
                /* 1448 */
                slea.skip(4 * type);

            }
            /* 1450 */
            pos = slea.readPos();

        }
        /* 1452 */
        else if (slea.available() > 4L) {
            /* 1453 */
            switch (skillid) {


                case 400041033:
                    /* 1456 */
                    slea.skip(4);

                    break;

            }

            /* 1460 */
            pos = slea.readPos();
            /* 1461 */
            if (slea.available() >= 7L && skillid != 400021030 && skillid != 151100002) {
                /* 1462 */
                slea.read(3);
                /* 1463 */
                direction = slea.readInt();

            }

        }


        /* 1468 */
        if (skillid == 151100002) {
            /* 1469 */
            slea.skip(24);
            /* 1470 */
            pos = slea.readPos();

        }


        /* 1474 */
        if (effect.is时空门()) {
            /* 1475 */
            if (!FieldLimitType.MysticDoor.check(chr.getMap().getFieldLimit())) {
                /* 1476 */
                effect.applyTo(c.getPlayer(), pos);

            } else {
                /* 1478 */
                c.announce(MaplePacketCreator.enableActions());

            }

        } else {
            /* 1481 */
            int mountid = MapleStatEffectFactory.parseMountInfo(c.getPlayer(), skill.getId());
            /* 1482 */
            if (mountid != 0 && mountid != GameConstants.getMountItem(skill.getId(), chr) && !chr.isIntern() && chr.getBuffedValue(MapleBuffStat.骑兽技能) == null && chr.getInventory(MapleInventoryType.EQUIPPED).getItem((short) -122) == null &&
                    /* 1483 */         !GameConstants.isMountItemAvailable(mountid, chr.getJob())) {
                /* 1484 */
                c.announce(MaplePacketCreator.enableActions());


                return;

            }

            /* 1489 */
            if (effect.getSourceid() == 5321004) {
                /* 1490 */
                effect.applyTo(chr, pos);
                /* 1491 */
                effect = SkillFactory.getSkill(5320011).getEffect(skillLevel);
                /* 1492 */
                if (pos != null) {
                    /* 1493 */
                    pos.x -= 90;

                }
                /* 1495 */
                if (effect != null) {
                    /* 1496 */
                    effect.applyTo(chr, pos);

                }
                /* 1498 */
            } else if (effect.is集合船员()) {
                /* 1499 */
                effect.applyTo(chr, pos);
                /* 1500 */
                List<Integer> skillIds = new ArrayList<>();
                /* 1501 */
                for (int i7 = 5210015; i7 <= 5210018; i7++) {
                    /* 1502 */
                    if (i7 != effect.getSourceid()) {
                        /* 1503 */
                        skillIds.add(Integer.valueOf(i7));

                    }

                }
                /* 1506 */
                skillid = ((Integer) skillIds.get(Randomizer.nextInt(skillIds.size()))).intValue();
                /* 1507 */
                effect = SkillFactory.getSkill(skillid).getEffect(skillLevel);
                /* 1508 */
                if (pos != null) {
                    /* 1509 */
                    pos.x -= 90;

                }
                /* 1511 */
                if (effect != null) {
                    /* 1512 */
                    effect.applyTo(chr, pos);

                }
                /* 1514 */
            } else if (SkillConstants.is猴子护卫队(effect.getSourceid())) {
                /* 1515 */
                effect = SkillFactory.getSkill(400051052).getEffect(skillLevel);
                /* 1516 */
                if (effect != null) {
                    /* 1517 */
                    effect.applyTo(chr, pos, true);

                }
                /* 1519 */
                effect = SkillFactory.getSkill(400051053).getEffect(skillLevel);
                /* 1520 */
                if (effect != null) {
                    /* 1521 */
                    effect.applyTo(chr, pos, true);

                }
                /* 1523 */
                effect = SkillFactory.getSkill(400051038).getEffect(skillLevel);
                /* 1524 */
                if (effect != null) {
                    /* 1525 */
                    effect.applyTo(chr, pos);

                }
                /* 1527 */
            } else if (effect.getSourceid() == 400011077) {
                /* 1528 */
                effect = SkillFactory.getSkill(400011078).getEffect(skillLevel);
                /* 1529 */
                if (effect != null) {
                    /* 1530 */
                    effect.applyTo(chr, pos, true);

                }
                /* 1532 */
                effect = SkillFactory.getSkill(400011077).getEffect(skillLevel);
                /* 1533 */
                if (effect != null) {
                    /* 1534 */
                    effect.applyTo(chr, pos);

                }
                /* 1536 */
            } else if (effect.is诺巴守卫()) {
                /* 1537 */
                effect = SkillFactory.getSkill(400011013).getEffect(skillLevel);
                /* 1538 */
                if (effect != null) {
                    /* 1539 */
                    effect.applyTo(chr, pos, true);

                }
                /* 1541 */
                effect = SkillFactory.getSkill(400011014).getEffect(skillLevel);
                /* 1542 */
                if (pos != null) {
                    /* 1543 */
                    pos.x -= 120;

                }
                /* 1545 */
                if (effect != null) {
                    /* 1546 */
                    effect.applyTo(chr, pos, true);

                }
                /* 1548 */
                effect = SkillFactory.getSkill(400011012).getEffect(skillLevel);
                /* 1549 */
                if (pos != null) {
                    /* 1550 */
                    pos.x += 240;

                }
                /* 1552 */
                if (effect != null) {
                    /* 1553 */
                    effect.applyTo(chr, pos);

                }
                /* 1555 */
            } else if (effect.is炎虎飚()) {
                /* 1556 */
                for (int i7 = 400051029; i7 <= 400051032; i7++) {
                    /* 1557 */
                    effect = SkillFactory.getSkill(i7).getEffect(skillLevel);
                    /* 1558 */
                    if (effect != null) {
                        /* 1559 */
                        effect.applyTo(chr, pos, true);

                    }

                }
                /* 1562 */
                effect = SkillFactory.getSkill(400051028).getEffect(skillLevel);
                /* 1563 */
                if (effect != null) {
                    /* 1564 */
                    effect.applyTo(chr, pos);

                }
                /* 1566 */
            } else if (effect.is晓之阵集结()) {

                /* 1568 */
                List<Integer> skillIds = new ArrayList<>();
                /* 1569 */
                for (int i7 = 400001032; i7 <= 400001033; i7++) {
                    /* 1570 */
                    if (i7 != effect.getSourceid()) {
                        /* 1571 */
                        skillIds.add(Integer.valueOf(i7));

                    }

                }
                /* 1574 */
                skillid = ((Integer) skillIds.get(Randomizer.nextInt(skillIds.size()))).intValue();
                /* 1575 */
                effect = SkillFactory.getSkill(skillid).getEffect(skillLevel);
                /* 1576 */
                if (effect != null) {
                    /* 1577 */
                    effect.applyTo(chr, pos);

                }


                /* 1581 */
                List<Integer> skillIds2 = new ArrayList<>();
                /* 1582 */
                for (int i8 = 400001034; i8 <= 400001035; i8++) {
                    /* 1583 */
                    if (i8 != effect.getSourceid()) {
                        /* 1584 */
                        skillIds2.add(Integer.valueOf(i8));

                    }

                }
                /* 1587 */
                skillid = ((Integer) skillIds2.get(Randomizer.nextInt(skillIds2.size()))).intValue();
                /* 1588 */
                effect = SkillFactory.getSkill(skillid).getEffect(skillLevel);
                /* 1589 */
                if (pos != null) {
                    /* 1590 */
                    pos.x -= 50;

                }
                /* 1592 */
                if (effect != null)
                     {
                    /* 1594 */
                    effect.applyTo(chr, pos, true);

                }

            } else {
                /* 1597 */
                effect.applyTo(chr, pos, direction);

            }

        }
    }



    public static void absorbingDF(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {

        int oid, i, oldmobid, time, newmobid;

        MapleStatEffect effect;
        /* 1604 */
        if (chr == null || chr.getMap() == null) {

            return;

        }

        /* 1608 */
        int size = slea.readInt();
        /* 1609 */
        int skillid = slea.readInt();
        /* 1610 */
        for (int int3 = slea.readInt(), j = 0; j < int3; j++) {
            /* 1611 */
            slea.readInt();
            /* 1612 */
            slea.readInt();
            /* 1613 */
            slea.readInt();
            /* 1614 */
            slea.readInt();

        }

        /* 1617 */
        switch (skillid) {

            case 0:
                /* 1619 */
                if (JobConstants.is恶魔猎手(chr.getJob())) {
                    /* 1620 */
                    int k = slea.readInt();
                    /* 1621 */
                    int revdf = chr.getSpecialStat().removeForceCounter(k);



                    /* 1625 */
                    if (revdf > 0) {
                        /* 1626 */
                        chr.addMP(revdf, true);

                    }

                }

                break;


            case 31221014:
                /* 1632 */
                oid = slea.readInt();
                /* 1633 */
                slea.skip(1);
                /* 1634 */
                oldmobid = slea.readInt();
                /* 1635 */
                time = slea.readInt();
                /* 1636 */
                newmobid = slea.readInt();
                /* 1637 */
                effect = SkillFactory.getSkill(skillid).getEffect(chr.getTotalSkillLevel(skillid));
                /* 1638 */
                if (oid <= effect.getZ()) {
                    /* 1639 */
                    c.getPlayer().getMap().broadcastMessage(ForcePacket.ShieldChacingRe(c.getPlayer().getId(), oldmobid, newmobid, oid), chr.getTruePosition());

                }

                break;


            case 14000028:
                /* 1644 */
                slea.readInt();
                /* 1645 */
                for (i = 0; i < size; i++) {
                    /* 1646 */
                    slea.skip(1);
                    /* 1647 */
                    int k = slea.readInt();
                    /* 1648 */
                    MapleMonster mob = chr.getMap().getMonsterByOid(k);
                    /* 1649 */
                    if (mob != null) {
                        /* 1650 */
                        chr.getSpecialStat().gainForceCounter();
                        /* 1651 */
                        c.getPlayer().getMap().broadcastMessage(ForcePacket.Show影子蝙蝠_分裂(chr.getId(), mob.getId(), mob.getTruePosition(), k, chr.getSpecialStat().getForceCounter()), chr.getTruePosition());
                        /* 1652 */
                        chr.getSpecialStat().gainForceCounter();

                    }

                }

                /* 1656 */
                chr.removeSummon(14000027);

                break;

        }

    }












    public static void attackProcessing(LittleEndianAccessor slea, MapleClient c, RecvPacketOpcode header) {
        MapleCharacter chr = c.getPlayer();
        if (chr == null || chr.hasBlockedInventory() || chr.getMap() == null) {
            c.sendEnableActions();
            return;
        }
        if (ServerConfig.WORLD_BANALLSKILL) {
            chr.dropMessage(5, "管理员禁止了技能施放.");
            c.sendEnableActions();
            return;
        }

        if (!chr.isAdmin() && chr.getMap().isMarketMap()) {
            c.sendEnableActions();
            return;
        }
        if (chr.getGMLevel() >= 3 && chr.getGMLevel() <= 5 && chr.getMap().isBossMap()) {
            c.sendEnableActions();
            return;
        }
        switch (header) {
            case CLOSE_RANGE_ATTACK://近距离攻击
                PlayerHandler.closeRangeAttack(slea, c, chr, header);
                break;
            case RANGED_ATTACK://远距离攻击
                PlayerHandler.rangedAttack(slea, c, chr);
                break;
            case MAGIC_ATTACK://魔法攻击
                PlayerHandler.MagicDamage(slea, c, chr,header);
                break;
            case SUMMON_ATTACK://召唤兽攻击
                SummonHandler.SummonAttack(slea, c, chr);
                break;
            case PASSIVE_ENERGY:
            case CLUSTER_ATTACK:
                PlayerHandler.passiveRangeAttack(slea, c, chr,header);
                break;
        }
        chr.monsterMultiKill();

    }










    public static void closeRangeAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, RecvPacketOpcode header) {
        /* 1726 */
        closeRangeAttack(slea, c, chr, false, false, false, header);

    }










    public static void passiveRangeAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, RecvPacketOpcode header) {
        /* 1737 */
        closeRangeAttack(slea, c, chr, true, false, false, header);

    }










    public static void clusterRangeAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, RecvPacketOpcode header) {
        /* 1748 */
        closeRangeAttack(slea, c, chr, false, true, false, header);

    }



    public static void spotlightAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, RecvPacketOpcode header) {
        /* 1752 */
        closeRangeAttack(slea, c, chr, false, false, true, header);

    }












    public static void closeRangeAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, boolean energy, boolean cluster, boolean spotlight, RecvPacketOpcode header) {
        /* 1765 */
        AttackInfo attack = null;
        /* 1766 */
        if (header == RecvPacketOpcode.CLUSTER_ATTACK) {
            /* 1767 */
            attack = 攻击解析.解析弩骑集束箭攻击数据包(slea, c, chr);
            /* 1768 */
        } else if (header == RecvPacketOpcode.PASSIVE_ENERGY) {
            /* 1769 */
            attack = 攻击解析.解析被动攻击(slea, c, chr);
            /* 1770 */
        } else if (cluster) {
            /* 1771 */
            attack = DamageParse.parseCloseRangeAttack(slea, chr, energy, cluster, spotlight);
            /* 1772 */
        } else if (spotlight) {
            /* 1773 */
            attack = DamageParse.parseCloseRangeAttack(slea, chr, energy, cluster, spotlight);

        } else {
            /* 1775 */
            attack = 攻击解析.解析近距离攻击数据包(slea, c, chr);

        }


        /* 1779 */
        if (attack == null) {
            /* 1780 */
            if (chr.isShowPacket()) {
                /* 1781 */
                chr.dropDebugMessage(3, "[近距离攻击] 远距离攻击封包解析返回为空.");

            }
            /* 1783 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }
        /* 1787 */
        if (SkillFactory.isBlockedSkill(attack.skillId)) {
            /* 1788 */
            chr.dropMessage(5, "由于<" + SkillFactory.getSkillName(attack.skillId) + ">技能数据异常,暂未开放使用.");
            /* 1789 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }
        /* 1793 */
        if (attack.skillId != 0 && chr.isShowPacket()) {
            /* 1794 */
            chr.dropDebugMessage(1, "[近距离攻击] 技能: " + SkillFactory.getSkillName(attack.skillId) + "(" + attack.skillId + ") 技能等级: " + attack.skllv + " 攻击次数: " + attack.numAttacked + " 伤害次数: " + attack.numDamage);

        }

        /* 1797 */
        boolean hasMoonBuff = (chr.getBuffedIntValue(MapleBuffStat.月光转换) == 1 || chr.getBuffedValue(MapleBuffStat.虚弱) != null);
        /* 1798 */
        double maxdamage = chr.getStat().getCurrentMaxBaseDamage();
        /* 1799 */
        Item shield = c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem((short) -10);
        /* 1800 */
        int attackCount = (shield != null && shield.getItemId() / 10000 == 134) ? 2 : 1;
        /* 1801 */
        int skillLevel = 0;
        /* 1802 */
        MapleStatEffect effect = null;
        /* 1803 */
        Skill skill = null;

        /* 1805 */
        if (attack.skillId != 0) {
            /* 1806 */
            int linkSkillId = SkillConstants.getLinkedAttackSkill(attack.skillId);
            /* 1807 */
            skill = SkillFactory.getSkill(linkSkillId);
            /* 1808 */
            if (skill == null || (SkillConstants.is天使祝福戒指(attack.skillId) && (chr.getStat()).equippedSummon % 10000 != attack.skillId % 10000)) {
                /* 1809 */
                c.announce(MaplePacketCreator.enableActions());

                return;

            }
            /* 1812 */
            skillLevel = chr.getTotalSkillLevel(linkSkillId);
            /* 1813 */
            effect = attack.getAttackEffect(chr, skillLevel, skill);
            /* 1814 */
            if (effect == null || skillLevel < 0) {
                /* 1815 */
                chr.dropDebugMessage(2, "[近距离攻击] 技能: " + SkillFactory.getSkillName(attack.skillId) + "(" + attack.skillId + ") 技能数据出现错误.");
                /* 1816 */
                Skill.log.error("近距离攻击效果为空 玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skill.getId() + " - " + skill.getName() + " 技能等级: " + skillLevel);
                /* 1817 */
                c.announce(MaplePacketCreator.enableActions());


                return;

            }
            /* 1821 */
            if (attack.skillId == 21121057) {
                /* 1822 */
                chr.handle摩诃领域();

            }


            /* 1826 */
            if (attack.skillId == 155120000 || attack.skillId == 155120001)
                 {
                /* 1828 */
                if (chr.getTotalSkillLevel(400051047) > 0)
                     {
                    /* 1830 */
                    if (!chr.isSkillCooling((attack.skillId == 155120000) ? 400051047 : 400051048)) {
                        /* 1831 */
                        chr.send(MaplePacketCreator.userBonusAttackRequest((attack.skillId == 155120000) ? 400051047 : 400051048, 0, Collections.emptyList()));

                    }

                }

            }

            /* 1836 */
            if (chr.checkSoulWeapon() && attack.skillId == chr.getEquippedSoulSkill()) {
                /* 1837 */
                chr.checkSoulState(true);

            }





            /* 1844 */
            if (!SkillConstants.isNoApplyTo(attack.skillId) && !skill.isKeydownSkill() && !DamageParse.applyAttackCooldown(effect, chr, attack.skillId, skill.isChargeSkill(), false, energy)) {

                return;

            }

            /* 1848 */
            attackCount = effect.getAttackCount(chr);

        }
        /* 1850 */
        attack = DamageParse.Modify_AttackCrit(attack, chr, 1, effect);
        /* 1851 */
        attackCount *= hasMoonBuff ? 2 : 1;
        /* 1852 */
        if (!energy)
             {
            /* 1854 */
            if (JobConstants.is英雄(chr.getJob())) {
                /* 1855 */
                int numFinisherOrbs = 0;
                /* 1856 */
                Integer comboBuff = chr.getBuffedValue(MapleBuffStat.斗气集中);
                /* 1857 */
                if (SkillConstants.isFinisher(attack.skillId) > 0) {
                    /* 1858 */
                    if (comboBuff != null) {
                        /* 1859 */
                        numFinisherOrbs = comboBuff.intValue() - 1;

                    }
                    /* 1861 */
                    if (numFinisherOrbs > 0) {
                        /* 1862 */
                        chr.handleOrbconsume(SkillConstants.isFinisher(attack.skillId));
                        /* 1863 */
                        maxdamage *= numFinisherOrbs;

                    }

                }

            }

        }
        /* 1868 */
        if (JobConstants.is恶魔复仇者(chr.getJob())) {
            /* 1869 */
            chr.handle超越状态(attack.skillId);

        }
        /* 1871 */
        chr.checkFollow();
        /* 1872 */
        if (!SkillFactory.isBlockedSkill(attack.skillId) &&
                /* 1873 */       attack.skillId != 80001770) {
            /* 1874 */
            if (!chr.isHidden()) {
                /* 1875 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.closeRangeAttack(chr, skillLevel, 0, attack, energy, hasMoonBuff), chr.getTruePosition());

            } else {
                /* 1877 */
                chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.closeRangeAttack(chr, skillLevel, 0, attack, energy, hasMoonBuff), false);

            }

        }

        /* 1881 */
        int visProjectile = 0;
        /* 1882 */
        if (attack.skillId == 400041020 || attack.skillId == 400041038) {
            /* 1883 */
            Item item = chr.getInventory(MapleInventoryType.USE).getItem(attack.cashSlot);
            /* 1884 */
            if (item != null) {
                /* 1885 */
                visProjectile = chr.getInventory(MapleInventoryType.USE).getItem(attack.cashSlot).getItemId();

            }

        }

        /* 1889 */
        DamageParse.applyAttack(attack, skill, c.getPlayer(), attackCount, maxdamage, effect, visProjectile);

    }






    public static void rangedAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 1896 */
        AttackInfo attack = 攻击解析.解析远距离攻击(slea, c, chr);
        /* 1897 */
        if (attack == null) {
            /* 1898 */
            if (chr.isShowPacket()) {
                /* 1899 */
                chr.dropDebugMessage(3, "[远距离攻击] 远距离攻击封包解析返回为空.");

            }
            /* 1901 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 1904 */
        if (SkillFactory.isBlockedSkill(attack.skillId)) {
            /* 1905 */
            chr.dropMessage(5, "由于<" + SkillFactory.getSkillName(attack.skillId) + ">技能数据异常,暂未开放使用.");
            /* 1906 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }

        /* 1911 */
        int bulletCount = 1, skillLevel = 0;
        /* 1912 */
        MapleStatEffect effect = null;
        /* 1913 */
        Skill skill = null;


        /* 1916 */
        boolean noBullet = (attack.starSlot == 0 || JobConstants.noBulletJob(chr.getJob()));


        /* 1919 */
        if (attack.skillId != 0) {
            /* 1920 */
            skill = SkillFactory.getSkill(attack.skillId);

            /* 1922 */
            if (skill == null || (SkillConstants.is天使祝福戒指(attack.skillId) && (chr.getStat()).equippedSummon % 10000 != attack.skillId % 10000)) {
                /* 1923 */
                c.announce(MaplePacketCreator.enableActions());


                return;

            }
            /* 1927 */
            skillLevel = chr.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(attack.skillId));

            /* 1929 */
            effect = attack.getAttackEffect(chr, skillLevel, skill);
            /* 1930 */
            if (effect == null) {

                /* 1932 */
                Skill.log.error("远距离攻击效果为空 玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skill.getId() + " - " + skill.getName() + " 技能等级: " + skillLevel);
                /* 1933 */
                c.announce(MaplePacketCreator.enableActions());


                return;

            }
            /* 1937 */
            bulletCount = Math.max(effect.getBulletCount(chr), effect.getAttackCount(chr));






            /* 1944 */
            if (!SkillConstants.isNoApplyTo(attack.skillId) && !skill.isKeydownSkill() && !DamageParse.applyAttackCooldown(effect, chr, attack.skillId, skill.isChargeSkill(), false, false)) {

                return;

            }

        }


        /* 1950 */
        attack = DamageParse.Modify_AttackCrit(attack, chr, 2, effect);


        /* 1953 */
        boolean mirror = (chr.getBuffedValue(MapleBuffStat.影分身) != null);


        /* 1956 */
        bulletCount *= mirror ? 2 : 1;


        /* 1959 */
        int projectile = 0, visProjectile = 0;


        /* 1962 */
        if (!noBullet && chr.getBuffedValue(MapleBuffStat.无形箭弩) == null && !JobConstants.is幻影(chr.getJob())) {
            /* 1963 */
            Item item = chr.getInventory(MapleInventoryType.USE).getItem(attack.starSlot);
            /* 1964 */
            if (item == null) {

                return;

            }
            /* 1967 */
            projectile = item.getItemId();
            /* 1968 */
            if (attack.cashSlot > 0) {
                /* 1969 */
                if (chr.getInventory(MapleInventoryType.CASH).getItem(attack.cashSlot) == null) {

                    return;

                }
                /* 1972 */
                visProjectile = chr.getInventory(MapleInventoryType.CASH).getItem(attack.cashSlot).getItemId();

            } else {
                /* 1974 */
                visProjectile = projectile;

            }

            /* 1977 */
            if (chr.getBuffedValue(MapleBuffStat.暗器伤人) == null) {
                /* 1978 */
                int bulletConsume = bulletCount;
                /* 1979 */
                if (effect != null && effect.getBulletConsume() != 0) {
                    /* 1980 */
                    bulletConsume = effect.getBulletConsume() * (mirror ? 2 : 1);

                }
                /* 1982 */
                if (chr.getJob() == 412 && bulletConsume > 0 && item.getQuantity() < MapleItemInformationProvider.getInstance().getSlotMax(projectile)) {
                    /* 1983 */
                    Skill expert = SkillFactory.getSkill(4110012);
                    /* 1984 */
                    if (chr.getTotalSkillLevel(expert) > 0) {
                        /* 1985 */
                        MapleStatEffect eff = expert.getEffect(chr.getTotalSkillLevel(expert));
                        /* 1986 */
                        if (eff.makeChanceResult()) {
                            /* 1987 */
                            item.setQuantity((short) (item.getQuantity() + 1));
                            /* 1988 */
                            c.announce(InventoryPacket.modifyInventory(false, Collections.singletonList(new ModifyInventory(1, item))));
                            /* 1989 */
                            bulletConsume = 0;
                            /* 1990 */
                            c.announce(InventoryPacket.getInventoryStatus());

                        }

                    }

                }
                /* 1994 */
                if (bulletConsume > 0) {
                    /* 1995 */
                    boolean useItem = true;
                    /* 1996 */
                    if (chr.getBuffedValue(MapleBuffStat.子弹数量) != null) {
                        /* 1997 */
                        int count = chr.getBuffedIntValue(MapleBuffStat.子弹数量) - bulletConsume;
                        /* 1998 */
                        if (count >= 0) {
                            /* 1999 */
                            chr.setBuffedValue(MapleBuffStat.子弹数量, count);
                            /* 2000 */
                            useItem = false;

                        } else {
                            /* 2002 */
                            chr.cancelEffectFromBuffStat(MapleBuffStat.子弹数量);
                            /* 2003 */
                            bulletConsume += count;

                        }

                    }

                    /* 2007 */
                    if (useItem && !MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, projectile, bulletConsume, false, true)) {
                        /* 2008 */
                        chr.dropMessage(5, "您的箭/子弹/飞镖不足。");

                        return;

                    }

                }

            }
            /* 2013 */
        } else if (chr.getJob() >= 3500 && chr.getJob() <= 3512) {
            /* 2014 */
            visProjectile = 2333000;
            /* 2015 */
        } else if (JobConstants.is火炮手(chr.getJob())) {
            /* 2016 */
            visProjectile = 2333001;

        }

        /* 2019 */
        int projectileWatk = 0;
        /* 2020 */
        if (projectile != 0) {
            /* 2021 */
            projectileWatk = MapleItemInformationProvider.getInstance().getWatkForProjectile(projectile);

        }

        /* 2024 */
        PlayerStats statst = chr.getStat();

        /* 2026 */
        double basedamage = statst.getCurrentMaxBaseDamage() + statst.calculateMaxProjDamage(projectileWatk, chr);

        /* 2028 */
        switch (attack.skillId) {

            case 3101005:
                /* 2030 */
                if (effect != null) {
                    /* 2031 */
                    basedamage *= effect.getX() / 100.0D;

                }

                break;

        }
        /* 2035 */
        if (effect != null) {
            /* 2036 */
            basedamage *= (effect.getDamage() + statst.getDamageIncrease(attack.skillId)) / 100.0D;
            /* 2037 */
            long money = effect.getMoneyCon();
            /* 2038 */
            if (money != 0L) {
                /* 2039 */
                if (money > chr.getMeso()) {
                    /* 2040 */
                    money = chr.getMeso();

                }
                /* 2042 */
                chr.gainMeso(-money, false);

            }

        }
        /* 2045 */
        chr.checkFollow();

        /* 2047 */
        if (!SkillFactory.isBlockedSkill(attack.skillId)) {
            /* 2048 */
            if (!chr.isHidden()) {
                /* 2049 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.rangedAttack(chr, skillLevel, visProjectile, attack), chr.getTruePosition());

            } else {
                /* 2051 */
                chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.rangedAttack(chr, skillLevel, visProjectile, attack), false);

            }

        }
        /* 2054 */
        DamageParse.applyAttack(attack, skill, chr, bulletCount, basedamage, effect, visProjectile);

    }



    public static void MagicDamage(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, RecvPacketOpcode header) {
        /* 2058 */
        AttackInfo attack = null;

        /* 2060 */
        if (header == RecvPacketOpcode.MAGIC_ATTACK) {
            /* 2061 */
            attack = 攻击解析.解析魔法攻击(slea, c, chr);
            /* 2062 */
        } else if (header == RecvPacketOpcode.WARLOCK_MAGIC_ATTACK) {
            /* 2063 */
            attack = 攻击解析.解析轨道烈焰攻击(slea, c, chr);

        } else {
            /* 2065 */
            attack = 攻击解析.解析魔法攻击(slea, c, chr);

        }

        /* 2068 */
        if (attack == null) {
            /* 2069 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2072 */
        if (SkillFactory.isBlockedSkill(attack.skillId)) {
            /* 2073 */
            chr.dropMessage(5, "由于<" + SkillFactory.getSkillName(attack.skillId) + ">技能数据异常,暂未开放使用.");
            /* 2074 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2077 */
        if (chr.isShowPacket()) {
            /* 2078 */
            chr.dropDebugMessage(1, "[魔法攻击] 技能: " + SkillFactory.getSkillName(attack.skillId) + "(" + attack.skillId + ") 打怪数量: " + attack.numAttacked + " 打怪次数: " + attack.numDamage);

        }
        /* 2080 */
        Skill skill = SkillFactory.getSkill(attack.skillId);
        /* 2081 */
        if (skill == null || (SkillConstants.is天使祝福戒指(attack.skillId) && (chr.getStat()).equippedSummon % 10000 != attack.skillId % 10000)) {
            /* 2082 */
            Skill.log.error(attack.skillId + " 技能为空");
            /* 2083 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2086 */
        int skillLevel = chr.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(attack.skillId));
        /* 2087 */
        MapleStatEffect effect = attack.getAttackEffect(chr, skillLevel, skill);
        /* 2088 */
        if (effect == null) {
            /* 2089 */
            chr.dropDebugMessage(2, "[魔法攻击] 技能: " + SkillFactory.getSkillName(attack.skillId) + "(" + attack.skillId + ") 技能数据出现错误.");
            /* 2090 */
            Skill.log.error("魔法攻击效果为空 玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skill.getId() + " - " + skill.getName() + " 技能等级: " + skillLevel);




            return;

        }



        /* 2099 */
        if (!SkillConstants.isNoApplyTo(attack.skillId) && !skill.isKeydownSkill() && !DamageParse.applyAttackCooldown(effect, chr, attack.skillId, skill.isChargeSkill(), false, false)) {

            return;

        }

        /* 2103 */
        attack = DamageParse.Modify_AttackCrit(attack, chr, 3, effect);
        /* 2104 */
        double maxdamage = (chr.getStat().getCurrentMaxBaseDamage() * (effect.getDamage() + chr.getStat().getDamageIncrease(attack.skillId))) / 100.0D;
        /* 2105 */
        if (SkillConstants.isPyramidSkill(attack.skillId)) {
            /* 2106 */
            maxdamage = 1.0D;
            /* 2107 */
        } else if (JobConstants.is新手职业(skill.getId() / 10000) && skill.getId() % 10000 == 1000) {
            /* 2108 */
            maxdamage = 40.0D;

        }
        /* 2110 */
        chr.checkFollow();
        /* 2111 */
        if (!SkillFactory.isBlockedSkill(attack.skillId)) {
            /* 2112 */
            if (!chr.isHidden()) {
                /* 2113 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.magicAttack(chr, skillLevel, 0, attack), chr.getTruePosition());

            } else {
                /* 2115 */
                chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.magicAttack(chr, skillLevel, 0, attack), false);

            }

        }
        /* 2118 */
        DamageParse.applyAttackMagic(attack, skill, c.getPlayer(), effect, maxdamage);

    }



    public static void 处理聚光灯攻击(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2122 */
        AttackInfo attack = DamageParse.解析聚光灯(slea, chr);

        /* 2124 */
        if (attack == null) {
            /* 2125 */
            if (chr.isShowPacket()) {
                /* 2126 */
                chr.dropDebugMessage(3, "[聚光灯攻击] 聚光灯攻击封包解析返回为空.");

            }
            /* 2128 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }
        /* 2132 */
        if (SkillFactory.isBlockedSkill(attack.skillId)) {
            /* 2133 */
            chr.dropMessage(5, "由于<" + SkillFactory.getSkillName(attack.skillId) + ">技能数据异常,暂未开放使用.");
            /* 2134 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2137 */
        if (attack.skillId != 0 && chr.isShowPacket()) {
            /* 2138 */
            chr.dropDebugMessage(1, "[近距离攻击] 技能: " + SkillFactory.getSkillName(attack.skillId) + "(" + attack.skillId + ") 技能等级: " + attack.skllv + " 攻击次数: " + attack.numAttacked + " 伤害次数: " + attack.numDamage);

        }
        /* 2140 */
        double maxdamage = chr.getStat().getCurrentMaxBaseDamage();
        /* 2141 */
        boolean hasMoonBuff = (chr.getBuffedIntValue(MapleBuffStat.月光转换) == 1 || chr.getBuffedValue(MapleBuffStat.虚弱) != null);
        /* 2142 */
        Item shield = c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).getItem((short) -10);
        /* 2143 */
        int attackCount = (shield != null && shield.getItemId() / 10000 == 134) ? 2 : 1;
        /* 2144 */
        int skillLevel = 0;
        /* 2145 */
        MapleStatEffect effect = null;
        /* 2146 */
        Skill skill = null;
        /* 2147 */
        if (attack.skillId != 0) {
            /* 2148 */
            int linkSkillId = SkillConstants.getLinkedAttackSkill(attack.skillId);
            /* 2149 */
            skill = SkillFactory.getSkill(linkSkillId);
            /* 2150 */
            if (skill == null || (SkillConstants.is天使祝福戒指(attack.skillId) && (chr.getStat()).equippedSummon % 10000 != attack.skillId % 10000)) {
                /* 2151 */
                c.announce(MaplePacketCreator.enableActions());

                return;

            }
            /* 2154 */
            skillLevel = chr.getTotalSkillLevel(linkSkillId);
            /* 2155 */
            effect = attack.getAttackEffect(chr, skillLevel, skill);
            /* 2156 */
            if (effect == null || skillLevel < 0) {
                /* 2157 */
                chr.dropDebugMessage(2, "[近距离攻击] 技能: " + SkillFactory.getSkillName(attack.skillId) + "(" + attack.skillId + ") 技能数据出现错误.");
                /* 2158 */
                Skill.log.error("近距离攻击效果为空 玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skill.getId() + " - " + skill.getName() + " 技能等级: " + skillLevel);
                /* 2159 */
                c.announce(MaplePacketCreator.enableActions());


                return;

            }
            /* 2163 */
            if (chr.checkSoulWeapon() && attack.skillId == chr.getEquippedSoulSkill()) {
                /* 2164 */
                chr.checkSoulState(true);

            }





            /* 2171 */
            attackCount = effect.getAttackCount(chr);

        }

        /* 2174 */
        attack = DamageParse.Modify_AttackCrit(attack, chr, 1, effect);
        /* 2175 */
        attackCount *= 1;

        /* 2177 */
        chr.checkFollow();
        /* 2178 */
        if (!SkillFactory.isBlockedSkill(attack.skillId) &&
                /* 2179 */       attack.skillId != 80001770) {
            /* 2180 */
            if (!chr.isHidden()) {
                /* 2181 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.closeRangeAttack(chr, skillLevel, 0, attack, false, hasMoonBuff), chr.getTruePosition());

            } else {
                /* 2183 */
                chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.closeRangeAttack(chr, skillLevel, 0, attack, false, hasMoonBuff), false);

            }

        }



        /* 2189 */
        DamageParse.applyAttack(attack, skill, c.getPlayer(), attackCount, maxdamage, effect, 0);

    }



    public static void DropMeso(int meso, MapleCharacter chr) {
        /* 2193 */
        if (!chr.isAlive() || meso < 10 || meso > 50000 || meso > chr.getMeso()) {
            /* 2194 */
            chr.send(MaplePacketCreator.enableActions());





            return;

        }




        /* 2205 */
        chr.gainMeso(-meso, false, true);
        /* 2206 */
        chr.getMap().spawnMesoDrop(meso, chr.getTruePosition(), (MapleMapObject) chr, chr, true, (byte) 0);
        /* 2207 */
        chr.getCheatTracker().checkDrop(true);

    }



    public static void UserSupserCannotRequest(LittleEndianAccessor lea, MapleCharacter player) {
        /* 2211 */
        byte by2 = lea.readByte();
        /* 2212 */
        if (JobConstants.is尖兵(player.getJob())) {
            /* 2213 */
            Skill skill = SkillFactory.getSkill(400041007);
            /* 2214 */
            int totalSkillLevel = player.getTotalSkillLevel(400041007);
            /* 2215 */
            if (skill != null && totalSkillLevel > 0 && by2 == 0 && player.getBuffedIntValue(MapleBuffStat.超能光束炮) < 0) {
                /* 2216 */
                MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(400041007));
                /* 2217 */
                if (effect != null) {
                    /* 2218 */
                    player.setBuffedValue(MapleBuffStat.超能光束炮, 1);
                    /* 2219 */
                    long startTime = (player.getBuffStatValueHolder(MapleBuffStat.超能光束炮)).startTime;
                    /* 2220 */
                    int n2 = Math.min((int) (System.currentTimeMillis() - startTime) / effect.getY(), effect.getZ());
                    /* 2221 */
                    HashMap<MapleBuffStat, Integer> hashMap = new HashMap<>();
                    /* 2222 */
                    hashMap.put(MapleBuffStat.超能光束炮, Integer.valueOf(1));
                    /* 2223 */
                    hashMap.put(MapleBuffStat.SECONDARY_STAT_IndieInvincible, Integer.valueOf(1));
                    /* 2224 */
                    player.setSchedule(MapleBuffStat.超能光束炮, Timer.BuffTimer.getInstance().schedule((Runnable) new MapleStatEffect.CancelEffectAction(player, effect, startTime, hashMap), (effect.getDuration() + n2 * 1000)));
                    /* 2225 */
                    player.setSchedule(MapleBuffStat.SECONDARY_STAT_IndieInvincible, Timer.BuffTimer.getInstance().schedule((Runnable) new MapleStatEffect.CancelEffectAction(player, effect, startTime, hashMap), (effect.getDuration() + n2 * 1000)));
                    /* 2226 */
                    player.updateBuffEffect(effect, hashMap);

                }

            }

        }

    }






    public static void ChangeAndroidEmotion(int emote, MapleCharacter chr) {
        /* 2236 */
        if (emote > 0 && chr != null && chr.getMap() != null && !chr.isHidden() && emote <= 17 && chr.getAndroid() != null) {
            /* 2237 */
            chr.getMap().broadcastMessage(AndroidPacket.showAndroidEmotion(chr.getId(), emote));

        }

    }



















    public static void MoveAndroid(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2258 */
        if (chr == null || chr.getAndroid() == null) {

            return;

        }
        /* 2261 */
        int v169 = slea.readInt();
        /* 2262 */
        int tEncodedGatherDuration = slea.readInt();
        /* 2263 */
        Point startPos = slea.readPos();
        /* 2264 */
        Point velPos = slea.readPos();

        /* 2266 */
        List<LifeMovementFragment> res = MovementParse.parseMovement(slea, 9);
        /* 2267 */
        if (res != null && !res.isEmpty() && chr.getMap() != null && chr.getAndroid() != null) {


            /* 2270 */
            startPos = chr.getAndroid().getPos();
            /* 2271 */
            chr.getAndroid().updatePosition(res);
            /* 2272 */
            chr.getMap().broadcastMessage(chr, AndroidPacket.moveAndroid(chr.getId(), v169, tEncodedGatherDuration, startPos, velPos, res), false);

        }

    }






    public static void ChangeEmotion(int emote, MapleCharacter chr) {
        /* 2280 */
        if (chr != null) {
            /* 2281 */
            if (emote > 7) {
                /* 2282 */
                int emoteid = 5159992 + emote;
                /* 2283 */
                MapleInventoryType type = ItemConstants.getInventoryType(emoteid);
                /* 2284 */
                if (type != null && chr.getInventory(type).findById(emoteid) == null) {
                    /* 2285 */
                    chr.getCheatTracker().registerOffense(CheatingOffense.USING_UNAVAILABLE_ITEM, Integer.toString(emoteid));

                    return;

                }

            }
            /* 2289 */
            if (emote > 0 && chr.getMap() != null && !chr.isHidden()) {
                /* 2290 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.facialExpression(chr, emote), false);

            }

        }

    }






    public static void Heal(LittleEndianAccessor slea, MapleCharacter chr) {
        /* 2299 */
        if (chr == null) {

            return;

        }
        /* 2302 */
        chr.updateTick(slea.readInt());
        /* 2303 */
        slea.skip(4);
        /* 2304 */
        slea.skip(4);
        /* 2305 */
        int healHP = slea.readShort();
        /* 2306 */
        int healMP = slea.readShort();
        /* 2307 */
        PlayerStats stats = chr.getStat();
        /* 2308 */
        if (stats.getHp() <= 0) {

            return;

        }
        /* 2311 */
        long now = System.currentTimeMillis();
        /* 2312 */
        if (healHP != 0 && chr.canHP(now + 1000L)) {
            /* 2313 */
            if (healHP > stats.getHealHP())
                 {
                /* 2315 */
                healHP = (int) stats.getHealHP();

            }
            /* 2317 */
            chr.addHP(healHP);

        }
        /* 2319 */
        if (healMP != 0 && !JobConstants.isNotMpJob(chr.getJob()) && chr.canMP(now + 1000L)) {
            /* 2320 */
            if (healMP > stats.getHealMP())
                 {
                /* 2322 */
                healMP = (int) stats.getHealMP();

            }
            /* 2324 */
            chr.addMP(healMP);

        }

    }


    public static void MovePlayer(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {

        List<LifeMovementFragment> res;
        /* 2329 */
        if (chr == null) {

            return;

        }
        /* 2332 */
        slea.skip(10);
        /* 2333 */
        int v169 = slea.readInt();
        /* 2334 */
        int tEncodedGatherDuration = slea.readInt();
        /* 2335 */
        Point startPos = slea.readPos();
        /* 2336 */
        Point velPos = slea.readPos();


        try {
            /* 2339 */
            res = MovementParse.parseMovement(slea, 1);
            /* 2340 */
        } catch (ArrayIndexOutOfBoundsException e) {
            /* 2341 */
            MovementParse.log.error("AIOBE Type1:\r\n" + slea.toString(true));


            return;

        }
        /* 2345 */
        if (res != null && chr.getMap() != null) {





            /* 2351 */
            startPos = chr.getPosition();

            /* 2353 */
            MapleMap map = c.getPlayer().getMap();
            /* 2354 */
            if (chr.isHidden()) {
                /* 2355 */
                chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.movePlayer(chr.getId(), v169, tEncodedGatherDuration, startPos, velPos, res), false);

            } else {
                /* 2357 */
                chr.getMap().broadcastMessage(chr, MaplePacketCreator.movePlayer(chr.getId(), v169, tEncodedGatherDuration, startPos, velPos, res), false);

            }

            /* 2360 */
            MovementParse.updatePosition(res, (AnimatedMapleMapObject) chr, 0);
            /* 2361 */
            Point pos = chr.getTruePosition();
            /* 2362 */
            map.movePlayer(chr, pos);
            /* 2363 */
            if (chr.getFollowId() > 0 && chr.isFollowOn() && chr.isFollowInitiator()) {
                /* 2364 */
                MapleCharacter fol = map.getCharacterById(chr.getFollowId());
                /* 2365 */
                if (fol != null) {


                    /* 2368 */
                    startPos = fol.getPosition();
                    /* 2369 */
                    fol.getClient().announce(MaplePacketCreator.moveFollow(v169, tEncodedGatherDuration, startPos, velPos, pos, res));

                    /* 2371 */
                    MovementParse.updatePosition(res, (AnimatedMapleMapObject) fol, 0);
                    /* 2372 */
                    map.movePlayer(fol, pos);

                    /* 2374 */
                    map.broadcastMessage(fol, MaplePacketCreator.movePlayer(fol.getId(), v169, tEncodedGatherDuration, startPos, velPos, res), false);

                } else {
                    /* 2376 */
                    chr.checkFollow();

                }

            }
            /* 2379 */
            int count = chr.getFallCounter();
            /* 2380 */
            boolean samepos = (pos.y > (chr.getOldPosition()).y && Math.abs(pos.x - (chr.getOldPosition()).x) < 5);
            /* 2381 */
            if (samepos && (pos.y > map.getBottom() + 250 || map.getFootholds().findBelow(pos, true) == null)) {
                /* 2382 */
                if (count > 5) {
                    /* 2383 */
                    chr.changeMap(map, map.getPortal(0));
                    /* 2384 */
                    chr.setFallCounter(0);

                } else {
                    /* 2386 */
                    chr.setFallCounter(++count);

                }
                /* 2388 */
            } else if (count > 0) {
                /* 2389 */
                chr.setFallCounter(0);

            }
            /* 2391 */
            chr.setOldPosition(pos);
            /* 2392 */
            BattleConstants.PokemonMap mapp = BattleConstants.getMap(chr.getMapId());
            /* 2393 */
            if (!samepos && chr.getBattler(0) != null && mapp != null && !chr.isHidden() && !chr.hasBlockedInventory())
                if (Randomizer.nextInt((chr.getBattler(0).getAbility() == BattleConstants.PokemonAbility.Stench) ? 20 : ((c.getPlayer().getBattler(0).getAbility() == BattleConstants.PokemonAbility.Illuminate) ? 5 : 10)) == 0) {
                    /* 2394 */
                    LinkedList<Pair<Integer, Integer>> set = BattleConstants.getMobs(mapp);
                    /* 2395 */
                    Collections.shuffle(set);
                    /* 2396 */
                    int resulting = 0;
                    /* 2397 */
                    for (Pair<Integer, Integer> i : set) {
                        /* 2398 */
                        if (Randomizer.nextInt(((Integer) i.right).intValue()) == 0) {
                            /* 2399 */
                            resulting = ((Integer) i.left).intValue();

                            break;

                        }

                    }
                    /* 2403 */
                    if (resulting > 0) {
                        /* 2404 */
                        PokemonBattle wild = new PokemonBattle(chr, resulting, mapp);
                        /* 2405 */
                        chr.changeMap(wild.getMap(), wild.getMap().getPortal(mapp.portalId));
                        /* 2406 */
                        chr.setBattle(wild);
                        /* 2407 */
                        wild.initiate(chr, mapp);

                    }

                }



            /* 2413 */
            if (chr.getLastAttackSkillId() == 4211002) {
                /* 2414 */
                Point mylt, myrb;
                chr.setLastAttackSkillId(0);
                /* 2415 */
                Point lt = new Point(-350, -120);
                /* 2416 */
                Point rb = new Point(30, 5);


                /* 2419 */
                startPos = chr.getPosition();
                /* 2420 */
                Point posFrom = new Point(startPos);
                /* 2421 */
                int range = Math.abs((chr.getTruePosition()).x - posFrom.x);
                /* 2422 */
                if (chr.isFacingLeft()) {
                    /* 2423 */
                    mylt = new Point(lt.x + posFrom.x - range, lt.y + posFrom.y);
                    /* 2424 */
                    myrb = new Point(rb.x + posFrom.x, rb.y + posFrom.y);

                } else {
                    /* 2426 */
                    myrb = new Point(lt.x * -1 + posFrom.x + range, rb.y + posFrom.y);
                    /* 2427 */
                    mylt = new Point(rb.x * -1 + posFrom.x, lt.y + posFrom.y);

                }
                /* 2429 */
                Rectangle bounds = new Rectangle(mylt.x, mylt.y, myrb.x - mylt.x, myrb.y - mylt.y);
                /* 2430 */
                Point dropto = new Point(0, (chr.getTruePosition()).y);
                /* 2431 */
                int dropto_x = (chr.getTruePosition()).x;
                /* 2432 */
                byte d = 1;
                /* 2433 */
                List<MapleMapObject> mapobjects = map.getMapObjectsInRect(bounds, Collections.singletonList(MapleMapObjectType.ITEM));
                /* 2434 */
                for (MapleMapObject mapobject : mapobjects) {
                    /* 2435 */
                    MapleMapItem mapitem = (MapleMapItem) mapobject;
                    /* 2436 */
                    mapitem.getLock().lock();

                    try {
                        /* 2438 */
                        if (mapitem.getMeso() > 0 && !mapitem.isPickedUp() && mapitem.getOwner() == chr.getId()) {
                            /* 2439 */
                            int meso = mapitem.getMeso();
                            /* 2440 */
                            Point dropfrom = new Point(mapitem.getTruePosition());

                            /* 2442 */
                            mapitem.setPickedUp(true);
                            /* 2443 */
                            map.broadcastMessage(InventoryPacket.removeItemFromMap(mapitem.getObjectId(), 0, 0), mapitem.getPosition());
                            /* 2444 */
                            map.removeMapObject((MapleMapObject) mapitem);

                            /* 2446 */
                            dropto.x = dropto_x + ((d % 2 == 0) ? (10 * (d + 1) / 2) : -(10 * d / 2));
                            /* 2447 */
                            map.spawnMesoDropEx(meso, dropfrom, dropto, (MapleMapObject) chr, chr, true, (byte) 0);
                            /* 2448 */
                            d = (byte) (d + 1);

                        }

                    } finally {
                        /* 2451 */
                        mapitem.getLock().unlock();

                    }

                }

            }

        }

    }



    public static void ChangeMapSpecial(String portal_name, MapleClient c, MapleCharacter chr) {
        /* 2459 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /* 2462 */
        MaplePortal portal = chr.getMap().getPortal(portal_name);
        /* 2463 */
        if (portal != null && !chr.hasBlockedInventory()) {
            /* 2464 */
            portal.enterPortal(c);

        } else {
            /* 2466 */
            c.announce(MaplePacketCreator.enableActions());

        }

    }



    public static void ChangeMap(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2471 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /* 2474 */
        if (chr.isBanned()) {
            /* 2475 */
            MapleMap to = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(910000000);
            /* 2476 */
            chr.changeMap(to, to.getPortal(0));
            /* 2477 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2480 */
        if (slea.available() != 0L) {

            /* 2482 */
            slea.readByte();
            /* 2483 */
            int targetid = slea.readInt();
            /* 2484 */
            MaplePortal portal = chr.getMap().getPortal(slea.readMapleAsciiString());
            /* 2485 */
            if (slea.available() >= 7L) {
                /* 2486 */
                chr.updateTick(slea.readInt());
                /* 2487 */
                slea.skip(1);

            }
            /* 2489 */
            slea.readByte();
            /* 2490 */
            short type = (short) slea.readByte();
            /* 2491 */
            boolean wheel = (type > 0 && chr.getMapId() / 1000000 != 925 && chr.getPQLog("原地复活") < ServerConfig.CHANNEL_PLAYER_RESUFREECOUNT);
            /* 2492 */
            if (targetid != -1 && !chr.isAlive()) {
                /* 2493 */
                chr.setStance(0);
                /* 2494 */
                if (chr.getEventInstance() != null && chr.getEventInstance().revivePlayer(chr) && chr.isAlive()) {

                    return;

                }
                /* 2497 */
                if (chr.getPyramidSubway() != null) {
                    /* 2498 */
                    chr.getStat().setHp(50, chr);
                    /* 2499 */
                    chr.getPyramidSubway().fail(chr);

                    return;

                }
                /* 2502 */
                if (!wheel) {
                    /* 2503 */
                    if (chr.getEventInstance() != null && chr.getEventInstance().revivePlayer(chr) && chr.isAlive()) {

                        return;

                    }
                    /* 2506 */
                    chr.cancelAllBuffs();
                    /* 2507 */
                    chr.getStat().setHp(50, chr);
                    /* 2508 */
                    MapleMap to = chr.getMap().getReturnMap();
                    /* 2509 */
                    chr.changeMap(to, to.getPortal(0));

                } else {
                    /* 2511 */
                    switch (type) {

                        case 7:
                            /* 2513 */
                            if (chr.haveItem(5511001, 1, false, true)) {
                                /* 2514 */
                                chr.setPQLog("原地复活");
                                /* 2515 */
                                chr.cancelAllBuffs();
                                /* 2516 */
                                c.announce(MTSCSPacket.INSTANCE.useWheel((byte) (chr.getInventory(MapleInventoryType.CASH).countById(5511001) - 1)));
                                /* 2517 */
                                chr.getStat().heal(chr);
                                /* 2518 */
                                MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, 5511001, 1, true, false);
                                /* 2519 */
                                MapleItemInformationProvider.getInstance().getItemEffect(2002059 + Randomizer.nextInt(4)).applyTo(chr);

                            }
                            /* 2521 */
                            chr.changeMap(chr.getMap(), chr.getTruePosition());
                            /* 2522 */
                            c.announce(MaplePacketCreator.enableActions());

                            return;


                        case 9:
                            /* 2526 */
                            c.announce(EffectPacket.playerDeadConfirm(1, 0));
                            /* 2527 */
                            c.announce(MaplePacketCreator.enableActions());

                            return;

                    }

                    /* 2531 */
                    if (!chr.haveItem(5510000, 1, false, true)) {
                        /* 2532 */
                        c.announce(MaplePacketCreator.enableActions());

                        return;

                    }
                    /* 2535 */
                    chr.cancelAllBuffs();
                    /* 2536 */
                    c.announce(MTSCSPacket.INSTANCE.useWheel((byte) (chr.getInventory(MapleInventoryType.CASH).countById(5510000) - 1)));
                    /* 2537 */
                    chr.getStat().setHp(chr.getStat().getMaxHp() / 100 * 40, chr);
                    /* 2538 */
                    MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, 5510000, 1, true, false);
                    /* 2539 */
                    MapleMap to = chr.getMap();
                    /* 2540 */
                    chr.changeMap(to, to.getPortal(0));
                    /* 2541 */
                    chr.dispelDebuffs();
                    /* 2542 */
                    chr.cancelAllDebuffs();
                    /* 2543 */
                    if (chr.haveItem(5133000, 1, false, true)) {
                        /* 2544 */
                        c.announce(MTSCSPacket.INSTANCE.useWheel((byte) (chr.getInventory(MapleInventoryType.CASH).countById(5133000) - 1)));
                        /* 2545 */
                        chr.silentGiveBuffs(PlayerBuffStorage.getBuffsFromStorage(chr.getId()));
                        /* 2546 */
                        MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, 5133000, 1, true, false);

                    }


                }

                /* 2551 */
            } else if (targetid != -1 && chr.isIntern()) {
                /* 2552 */
                MapleMap to = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(targetid);
                /* 2553 */
                chr.changeMap(to, to.getPortal(0));
                /* 2554 */
            } else if (targetid != -1 && !chr.isIntern()) {
                /* 2555 */
                int divi = chr.getMapId() / 100;
                /* 2556 */
                boolean unlock = false, warp = false;
                /* 2557 */
                if (divi == 9130401) {
                    /* 2558 */
                    warp = (targetid / 100 == 9130400 || targetid / 100 == 9130401);
                    /* 2559 */
                    if (targetid / 10000 != 91304) {
                        /* 2560 */
                        warp = true;
                        /* 2561 */
                        unlock = true;
                        /* 2562 */
                        targetid = 130030000;

                    }
                    /* 2564 */
                } else if (divi == 9130400) {
                    /* 2565 */
                    warp = (targetid / 100 == 9130400 || targetid / 100 == 9130401);
                    /* 2566 */
                    if (targetid / 10000 != 91304) {
                        /* 2567 */
                        warp = true;
                        /* 2568 */
                        unlock = true;
                        /* 2569 */
                        targetid = 130030000;

                    }
                    /* 2571 */
                } else if (divi == 9140900) {
                    /* 2572 */
                    warp = (targetid == 914090011 || targetid == 914090012 || targetid == 914090013 || targetid == 140090000);
                    /* 2573 */
                } else if (divi == 9120601 || divi == 9140602 || divi == 9140603 || divi == 9140604 || divi == 9140605) {
                    /* 2574 */
                    warp = (targetid == 912060100 || targetid == 912060200 || targetid == 912060300 || targetid == 912060400 || targetid == 912060500 || targetid == 3000100);
                    /* 2575 */
                    unlock = true;
                    /* 2576 */
                } else if (divi == 9101500) {
                    /* 2577 */
                    warp = (targetid == 910150006 || targetid == 101050010);
                    /* 2578 */
                    unlock = true;
                    /* 2579 */
                } else if (divi == 9140901 && targetid == 140000000) {
                    /* 2580 */
                    unlock = true;
                    /* 2581 */
                    warp = true;
                    /* 2582 */
                } else if (divi == 9240200 && targetid == 924020000) {
                    /* 2583 */
                    unlock = true;
                    /* 2584 */
                    warp = true;
                    /* 2585 */
                } else if (targetid == 980040000 && divi >= 9800410 && divi <= 9800450) {
                    /* 2586 */
                    warp = true;
                    /* 2587 */
                } else if (divi == 9140902 && (targetid == 140030000 || targetid == 140000000)) {
                    /* 2588 */
                    unlock = true;
                    /* 2589 */
                    warp = true;
                    /* 2590 */
                } else if (divi == 9000900 && targetid / 100 == 9000900 && targetid > chr.getMapId()) {
                    /* 2591 */
                    warp = true;
                    /* 2592 */
                } else if (divi / 1000 == 9000 && targetid / 100000 == 9000) {
                    /* 2593 */
                    unlock = (targetid < 900090000 || targetid > 900090004);
                    /* 2594 */
                    warp = true;
                    /* 2595 */
                } else if (divi / 10 == 1020 && targetid == 1020000) {
                    /* 2596 */
                    unlock = true;
                    /* 2597 */
                    warp = true;
                    /* 2598 */
                } else if (chr.getMapId() == 900090101 && targetid == 100030100) {
                    /* 2599 */
                    unlock = true;
                    /* 2600 */
                    warp = true;
                    /* 2601 */
                } else if (chr.getMapId() == 2010000 && targetid == 104000000) {
                    /* 2602 */
                    unlock = true;
                    /* 2603 */
                    warp = true;
                    /* 2604 */
                } else if (chr.getMapId() == 106020001 || chr.getMapId() == 106020502) {
                    /* 2605 */
                    if (targetid == chr.getMapId() - 1) {
                        /* 2606 */
                        unlock = true;
                        /* 2607 */
                        warp = true;

                    }
                    /* 2609 */
                } else if (chr.getMapId() == 0 && targetid == 10000) {
                    /* 2610 */
                    unlock = true;
                    /* 2611 */
                    warp = true;
                    /* 2612 */
                } else if (chr.getMapId() == 931000011 && targetid == 931000012) {
                    /* 2613 */
                    unlock = true;
                    /* 2614 */
                    warp = true;
                    /* 2615 */
                } else if (chr.getMapId() == 931000021 && targetid == 931000030) {
                    /* 2616 */
                    unlock = true;
                    /* 2617 */
                    warp = true;

                }
                /* 2619 */
                if (unlock) {
                    /* 2620 */
                    c.announce(UIPacket.IntroDisableUI(false));
                    /* 2621 */
                    c.announce(UIPacket.IntroLock(false));
                    /* 2622 */
                    c.announce(MaplePacketCreator.enableActions());

                }
                /* 2624 */
                if (warp) {
                    /* 2625 */
                    MapleMap to = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(targetid);
                    /* 2626 */
                    chr.changeMap(to, to.getPortal(0));

                }
                /* 2628 */
            } else if (portal != null && !chr.hasBlockedInventory()) {
                /* 2629 */
                portal.enterPortal(c);

            } else {
                /* 2631 */
                c.announce(MaplePacketCreator.enableActions());

            }

        }


        /* 2636 */
        if (chr.getAranCombo() > 0) {
            /* 2637 */
            chr.gainAranCombo(0, true);

        }

    }



    public static void InnerPortal(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2642 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /* 2645 */
        MaplePortal portal = chr.getMap().getPortal(slea.readMapleAsciiString());
        /* 2646 */
        int toX = slea.readShort();
        /* 2647 */
        int toY = slea.readShort();



        /* 2651 */
        if (portal == null)
             return;
        /* 2653 */
        if (portal.getPosition().distanceSq(chr.getTruePosition()) > 22500.0D && !chr.isGM()) {
            /* 2654 */
            chr.getCheatTracker().registerOffense(CheatingOffense.USING_FARAWAY_PORTAL);

            return;

        }
        /* 2657 */
        chr.getMap().movePlayer(chr, new Point(toX, toY));
        /* 2658 */
        chr.checkFollow();

    }






    public static void ReIssueMedal(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2665 */
        int questId = slea.readShort();
        /* 2666 */
        int itemId = slea.readInt();
        /* 2667 */
        MapleQuest quest = MapleQuest.getInstance(questId);
        /* 2668 */
        if ((((quest != null) ? 1 : 0) & ((quest.getMedalItem() > 0) ? 1 : 0)) != 0 && chr.getQuestStatus(quest.getId()) == 2 && quest.getMedalItem() == itemId) {
            /* 2669 */
            if (!chr.haveItem(itemId)) {
                /* 2670 */
                int price = 100;
                /* 2671 */
                int infoQuestId = 29949;
                /* 2672 */
                String infoData = "count=1";
                /* 2673 */
                if (chr.containsInfoQuest(infoQuestId, "count=")) {
                    /* 2674 */
                    String line = chr.getInfoQuest(infoQuestId);
                    /* 2675 */
                    String[] splitted = line.split("=");
                    /* 2676 */
                    if (splitted.length == 2) {
                        /* 2677 */
                        int data = Integer.parseInt(splitted[1]);
                        /* 2678 */
                        infoData = "count=" + (data + 1);
                        /* 2679 */
                        if (data == 1) {
                            /* 2680 */
                            price = 1000;
                            /* 2681 */
                        } else if (data == 2) {
                            /* 2682 */
                            price = 10000;
                            /* 2683 */
                        } else if (data == 3) {
                            /* 2684 */
                            price = 100000;

                        } else {
                            /* 2686 */
                            price = 1000000;

                        }

                    } else {
                        /* 2689 */
                        chr.dropMessage(1, "重新领取勋章出现错误");
                        /* 2690 */
                        c.announce(MaplePacketCreator.enableActions());

                        return;

                    }

                }
                /* 2694 */
                if (chr.getMeso() < price) {
                    /* 2695 */
                    chr.dropMessage(1, "本次重新需要金币: " + price + "\r\n请检查金币是否足够");
                    /* 2696 */
                    c.announce(MaplePacketCreator.enableActions());

                    return;

                }
                /* 2699 */
                chr.gainMeso(-price, true, true);
                /* 2700 */
                MapleInventoryManipulator.addById(c, itemId, (short) 1, "");
                /* 2701 */
                chr.updateInfoQuest(infoQuestId, infoData);
                /* 2702 */
                c.announce(MaplePacketCreator.updateMedalQuestInfo((byte) 0, itemId));

            } else {
                /* 2704 */
                c.announce(MaplePacketCreator.updateMedalQuestInfo((byte) 3, itemId));

            }

        } else {
            /* 2707 */
            c.announce(MaplePacketCreator.enableActions());

        }

    }






    public static void PlayerUpdate(MapleClient c, MapleCharacter chr) {
        /* 2715 */
        boolean autoSave = true;
        /* 2716 */
        if (!autoSave || chr == null || chr.getMap() == null) {

            return;

        }
        /* 2719 */
        if (chr.getCheatTracker().canSaveDB())
             {
            /* 2721 */
            chr.saveToDB(false, false);

        }

    }



    public static void DelTeachSkill(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2726 */
        int skillid = slea.readInt();
        /* 2727 */
        Skill an2 = SkillFactory.getSkill(skillid);
        /* 2728 */
        if (an2 == null || (!chr.getLinkSkills().containsKey(Integer.valueOf(skillid)) && SkillConstants.gn(skillid) <= 0)) {
            /* 2729 */
            c.sendEnableActions();
            /* 2730 */
            c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillid, 6));

            return;

        }
        /* 2733 */
        int toSkillId = SkillConstants.go(skillid);
        /* 2734 */
        SkillEntry skillEntry = (SkillEntry) chr.getSkills().get(Integer.valueOf(skillid));
        /* 2735 */
        if (toSkillId > 0 && skillEntry != null && chr.teachSkill(toSkillId, skillid, skillEntry.teachId, true) > -1) {
            /* 2736 */
            chr.changeTeachSkill(skillid, skillEntry.teachId, skillEntry.skillevel, true);

        }
        /* 2738 */
        c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillid, 0));

    }






    public static void SetTeachSkill(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2745 */
        int skillId = slea.readInt();
        /* 2746 */
        if (chr == null || chr.getMap() == null || chr.hasBlockedInventory()) {
            /* 2747 */
            c.announce(MaplePacketCreator.enableActions());
            /* 2748 */
            c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 7));

            return;

        }
        /* 2751 */
        if (chr.getSkillLevel(skillId) > 0) {
            /* 2752 */
            c.announce(MaplePacketCreator.enableActions());
            /* 2753 */
            c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 3));

            return;

        }
        /* 2756 */
        int toChrId = slea.readInt();
        /* 2757 */
        Pair<String, Integer> toChrInfo = MapleCharacterUtil.getNameById(toChrId, chr.getWorld());
        /* 2758 */
        if (toChrInfo == null) {
            /* 2759 */
            c.announce(MaplePacketCreator.enableActions());
            /* 2760 */
            c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 6));

            return;

        }
        /* 2763 */
        int toChrAccId = ((Integer) toChrInfo.getRight()).intValue();
        /* 2764 */
        MapleQuest quest = MapleQuest.getInstance(7783);
        /* 2765 */
        if (quest != null && chr.getAccountID() == toChrAccId) {

            /* 2767 */
            chr.fixTeachSkillLevel();

            /* 2769 */
            int toSkillId = SkillConstants.go(skillId);
            /* 2770 */
            Pair<Integer, SkillEntry> q3 = (Pair<Integer, SkillEntry>) chr.getSonOfLinkedSkills().get(Integer.valueOf(skillId));
            /* 2771 */
            if (toSkillId <= 0 || !chr.getSonOfLinkedSkills().containsKey(Integer.valueOf(skillId)) || q3 == null) {
                /* 2772 */
                c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 5));
                /* 2773 */
                c.announce(MaplePacketCreator.enableActions());

                return;

            }
            /* 2776 */
            if (chr.teachSkill(toSkillId, skillId, toChrId, false) > 0) {
                /* 2777 */
                chr.changeTeachSkill(skillId, toChrId, ((SkillEntry) q3.getRight()).skillevel, false);
                /* 2778 */
                quest.forceComplete(chr, 0);
                /* 2779 */
                int gn = SkillConstants.gn(skillId);
                /* 2780 */
                c.announce(MaplePacketCreator.SetLinkSkillResult(skillId, new Pair(Integer.valueOf(toChrId), chr.getLinkSkills().get(Integer.valueOf(skillId))), gn, chr.getTotalSkillLevel(gn)));
                /* 2781 */
                c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 1));

            } else {

                /* 2784 */
                c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 5));

            }

        } else {

            /* 2788 */
            c.announce(MaplePacketCreator.UpdateLinkSkillResult(skillId, 6));

        }

        /* 2791 */
        c.announce(MaplePacketCreator.enableActions());

    }














    public static void ChangeMarketMap(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2806 */
        if (chr == null || chr.getMap() == null || chr.hasBlockedInventory()) {
            /* 2807 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2810 */
        int chc = slea.readByte() + 1;
        /* 2811 */
        int toMapId = slea.readInt();

        /* 2813 */
        if (toMapId >= 910000001 && toMapId <= 910000022) {
            /* 2814 */
            if (c.getChannel() != chc) {
                /* 2815 */
                if (chr.getMapId() != toMapId) {

                    /* 2817 */
                    MapleMap to = ChannelServer.getInstance(chc).getMapFactory().getMap(toMapId);
                    /* 2818 */
                    chr.setMap(to);
                    /* 2819 */
                    chr.changeChannel(chc);

                } else {
                    /* 2821 */
                    chr.changeChannel(chc);

                }

            } else {
                /* 2824 */
                MapleMap to = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(toMapId);
                /* 2825 */
                chr.changeMap(to, to.getPortal(0));

            }

        } else {
            /* 2828 */
            c.announce(MaplePacketCreator.enableActions());

        }

    }






    public static void UseChronosphere(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2836 */
        if (chr == null || chr.getMap() == null || chr.hasBlockedInventory()) {
            /* 2837 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2840 */
        slea.readInt();
        /* 2841 */
        int toMapId = slea.readInt();
        /* 2842 */
        MapleMap moveTo = ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(toMapId);

        /* 2844 */
        if (MapFieldLimit.TELEPORTITEMLIMIT.check(moveTo.getFieldLimit())) {
            /* 2845 */
            c.announce(MTSCSPacket.INSTANCE.getTrockMessage((byte) 11));
            /* 2846 */
            c.sendEnableActions();
            /* 2847 */
            if (ServerConfig.WORLD_CHEAT_WARP) {
                /* 2848 */
                chr.ban("使用外挂传送全图", true, true, false);

            }


            return;

        }
        /* 2853 */
        if (moveTo == null || MapConstants.isBossMap(toMapId)) {
            /* 2854 */
            c.announce(MTSCSPacket.INSTANCE.getTrockMessage((byte) 11));
            /* 2855 */
            c.announce(MaplePacketCreator.errorChronosphere());

        }
        /* 2857 */
        else if (chr.get免费超时空券() > 0) {
            /* 2858 */
            chr.setPQLog("免费超时空券");
            /* 2859 */
            chr.dropMessage(5, "您使用了" + c.getChannelServer().getServerName() + "免费传送功能从 " + chr.getMap().getMapName() + " --> " + moveTo.getMapName() + " 今天还可以使用: " + chr.get免费超时空券() + " 次。");
            /* 2860 */
            chr.changeMap(moveTo, moveTo.getPortal(0));
            /* 2861 */
            if (chr.get免费超时空券() == 0) {
                /* 2862 */
                chr.dropMessage(1, "本周已无剩余免费超时空券\r\n再次使用将消耗超时空券。");

            }
            /* 2864 */
        } else if (chr.get超时空券() > 0) {
            /* 2865 */
            chr.set超时空券(chr.get超时空券() - 1);
            /* 2866 */
            chr.dropMessage(5, "你使用了超时空券从" + chr.getMap().getMapName() + "传送到" + moveTo.getMapName() + "剩余超时空券：" + chr.get超时空券() + "。");
            /* 2867 */
            chr.changeMap(moveTo, moveTo.getPortal(0));
            /* 2868 */
            if (chr.get超时空券() == 0) {
                /* 2869 */
                chr.dropMessage(1, "你所有的超时空券已经用完\r\n请及时充值。");

            }
            /* 2871 */
        } else if (chr.getCSPoints(2) >= 200) {
            /* 2872 */
            chr.dropMessage(5, "您使用了" + c.getChannelServer().getServerName() + "传送功能从 " + chr.getMap().getMapName() + " --> " + moveTo.getMapName() + " 抵用卷减少 200 点。");
            /* 2873 */
            chr.changeMap(moveTo, moveTo.getPortal(0));
            /* 2874 */
            chr.modifyCSPoints(2, -200);

        } else {
            /* 2876 */
            chr.dropMessage(5, "传送失败，您今天的免费传送次数已经用完或者您的抵用卷不足200点。");

        }

    }







    public static void useTempestBlades(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 2885 */
        if (chr == null || chr.hasBlockedInventory() || chr.getMap() == null || chr.getBuffedValue(MapleBuffStat.剑刃之壁) == null) {
            /* 2886 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2889 */
        int skillId = chr.getTrueBuffSource(MapleBuffStat.剑刃之壁);
        /* 2890 */
        int attackCount = (skillId == 61101002 || skillId == 61110211) ? 3 : ((skillId == 61120007 || skillId == 61121217) ? 5 : 0);
        /* 2891 */
        if (attackCount <= 0) {
            /* 2892 */
            chr.cancelEffectFromBuffStat(MapleBuffStat.剑刃之壁);
            /* 2893 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 2896 */
        int skillid = slea.readInt();
        /* 2897 */
        int mobs = slea.readInt();
        /* 2898 */
        List<Integer> moboids = new ArrayList<>();
        /* 2899 */
        for (int i = 0; i < mobs; i++) {
            /* 2900 */
            int moboid = slea.readInt();
            /* 2901 */
            MapleMonster mob = chr.getMap().getMonsterByOid(moboid);
            /* 2902 */
            if (mob != null && moboids.size() < attackCount) {
                /* 2903 */
                moboids.add(Integer.valueOf(moboid));

            }

        }
        /* 2906 */
        if (!moboids.isEmpty()) {
            /* 2907 */
            chr.getSpecialStat().gainForceCounter();


            /* 2910 */
            int skillLevel = chr.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(skillid));
            /* 2911 */
            MapleStatEffect effect = SkillFactory.getSkill(skillid).getEffect(skillLevel);
            /* 2912 */
            MapleForce mapleForce = new MapleForce(chr.getId(), skillid, 0, MapleForceType.剑刃之壁, (byte) 1, moboids, (byte) 1, attackCount, chr.getMap(), effect.getBulletCount());
            /* 2913 */
            chr.getMap().broadcastMessage(ForcePacket.showForce(mapleForce, null));
            /* 2914 */
            c.announce(MaplePacketCreator.enableActions());
            /* 2915 */
            chr.getSpecialStat().gainForceCounter(attackCount - 1);

        }
        /* 2917 */
        chr.cancelEffectFromBuffStat(MapleBuffStat.剑刃之壁);

    }








    public static void showPlayerCash(LittleEndianAccessor slea, MapleClient c) {
    }







    public static void quickBuyCashShopItem(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) throws SQLException {
        /* 2932 */
        int iv, neednx, accId = slea.readInt();
        /* 2933 */
        int playerId = slea.readInt();
        /* 2934 */
        int mode = slea.readInt();

        /* 2936 */
        slea.skip(4);
        /* 2937 */
        int toCharge = (slea.readByte() == 1) ? 1 : 2;
        /* 2938 */
        switch (mode) {

            case 10:
                /* 2940 */
                if (chr == null || chr.getMap() == null) {
                    /* 2941 */
                    c.announce(MaplePacketCreator.enableActions());

                    return;

                }
                /* 2944 */
                if (chr.getId() != playerId || chr.getAccountID() != accId) {
                    /* 2945 */
                    c.announce(MaplePacketCreator.enableActions());

                    return;

                }
                /* 2948 */
                if (chr.getCSPoints(toCharge) >= 600 && chr.getStorage().getSlots() < 93) {
                    /* 2949 */
                    chr.modifyCSPoints(toCharge, -600, false);
                    /* 2950 */
                    chr.getStorage().increaseSlots((byte) 4);
                    /* 2951 */
                    chr.getStorage().saveToDB();
                    /* 2952 */
                    c.announce(MaplePacketCreator.playerCashUpdate(mode, toCharge, chr));
                    break;

                }
                /* 2954 */
                chr.dropMessage(5, "扩充失败，点卷余额不足或者仓库栏位已超过上限。");

                break;


            case 11:

            case 12:

            case 13:

            case 14:

            case 15:
                /* 2962 */
                if (chr == null || chr.getMap() == null) {
                    /* 2963 */
                    c.announce(MaplePacketCreator.enableActions());

                    return;

                }
                /* 2966 */
                if (chr.getId() != playerId || chr.getAccountID() != accId) {
                    /* 2967 */
                    c.announce(MaplePacketCreator.enableActions());

                    return;

                }
                /* 2970 */
                iv = (mode == 11) ? 1 : ((mode == 12) ? 2 : ((mode == 13) ? 3 : ((mode == 14) ? 4 : ((mode == 15) ? 5 : -1))));
                /* 2971 */
                if (iv > 0) {
                    /* 2972 */
                    MapleInventoryType tpye = MapleInventoryType.getByType((byte) iv);
                    /* 2973 */
                    if (chr.getCSPoints(toCharge) >= 600 && chr.getInventory(tpye).getSlotLimit() < 127) {
                        /* 2974 */
                        chr.modifyCSPoints(toCharge, -600, false);
                        /* 2975 */
                        chr.getInventory(tpye).addSlot((short) 4);
                        /* 2976 */
                        c.announce(MaplePacketCreator.playerCashUpdate(mode, toCharge, chr));
                        break;

                    }
                    /* 2978 */
                    chr.dropMessage(1, "扩充失败，点卷余额不足或者栏位已超过上限。");

                    break;

                }
                /* 2981 */
                chr.dropMessage(1, "扩充失败，扩充的类型不正确。");

                break;


            case 5430001:

            case 5790002:
                /* 2986 */
                neednx = (mode == 5430001) ? 3000 : 1000;
                /* 2987 */
                if (c.getCSPoints(toCharge) >= neednx && ((
                        /* 2988 */           mode == 5430001 && c.gainAccCharSlot()) || (mode == 5790002 && c.gainAccCardSlot()))) {
                    /* 2989 */
                    c.modifyCSPoints(toCharge, -neednx);
                    /* 2990 */
                    c.announce(MaplePacketCreator.playerSoltUpdate(mode, c.getCSPoints(1), c.getCSPoints(2)));


                    return;

                }
                /* 2994 */
                c.dropMessage("扩充失败，点卷余额不足或者栏位已超过上限。");

                break;

        }

    }







    public static void changeZeroLook(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr, boolean end) {
        /* 3004 */
        if (chr == null || chr.getMap() == null) {
            /* 3005 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }
        /* 3009 */
        if (end) {
            /* 3010 */
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.removeZeroFromMap(chr.getId()), false);

        } else {
            /* 3012 */
            chr.changeZeroLook();

        }

    }




    public static void ExtraAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 3018 */
        if (player == null) {

            return;

        }
        /* 3021 */
        int skillid = slea.readInt();
        /* 3022 */
        int tYple = slea.readInt();
        /* 3023 */
        int modoid = slea.readInt();
        /* 3024 */
        player.updateTick(slea.readInt());
        /* 3025 */
        List<Integer> finalAttackSkills = SkillFactory.getFinalAttackSkills();
        /* 3026 */
        for (Integer integer : finalAttackSkills) {
            /* 3027 */
            Skill skill = SkillFactory.getSkill(integer.intValue());
            /* 3028 */
            int job = integer.intValue() / 10000;
            /* 3029 */
            int skilllevel = player.getSkillLevel(SkillConstants.getLinkedAttackSkill(integer.intValue()));
            /* 3030 */
            if (skill == null) {

                continue;

            }
            /* 3033 */
            MapleStatEffect effect = skill.getEffect(skilllevel);
            /* 3034 */
            if (job >= player.getJob() - 2 && job <= player.getJob() && skilllevel > 0 && effect != null && effect.makeChanceResult() && (player.isMainWeapon(job, 0) || (player.skillisCooling(2221007) && integer.intValue() == 2220014) || (player.skillisCooling(2121007) && integer.intValue() == 2120013)) && (integer.intValue() != 4341054 || player.getBuffedIntValue(MapleBuffStat.隐形剑) > 0)) {
                /* 3035 */
                Item weapon_ = player.getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11);
                /* 3036 */
                MapleWeaponType type = (weapon_ == null) ? MapleWeaponType.没有武器 : ItemConstants.getWeaponType(weapon_.getItemId());
                /* 3037 */
                player.getClient().announce(MaplePacketCreator.ExtraAttack(skillid, skill.getId(), type.getWeaponType(), tYple, modoid));
                break;

            }

        }
    }

    public static void MoveEnergyBall(LittleEndianAccessor slea, MapleClient c) {
        int cid, oid, skillid;
        short par2;
        int enerhe, s1;
        short par1;
        Point Pos;
        int s2;
        short par3;
        Point oidpos, point1;
        int i, skillId, level;

        byte dir;

        int j;

        short Temporary1;

        int k;

        short Temporary2, Temporary3;
        /* 3045 */
        int DirPos1, DirPos2, Type = slea.readShort();

        /* 3047 */
        switch (Type) {

            case 0:
                /* 3049 */
                cid = slea.readInt();
                /* 3050 */
                oid = slea.readInt();
                /* 3051 */
                enerhe = slea.readByte();
                /* 3052 */
                Pos = slea.readPos();
                /* 3053 */
                oidpos = new Point(0, 0);
                /* 3054 */
                if (enerhe == 5) {
                    /* 3055 */
                    oidpos = slea.readPos();

                }
                /* 3057 */
                slea.readShort();
                /* 3058 */
                i = slea.readInt();
                /* 3059 */
                level = slea.readInt();
                /* 3060 */
                j = slea.readInt();
                /* 3061 */
                k = slea.readShort();

                /* 3063 */
                c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.SummonEnergy1((short) Type, cid, c.getPlayer().getMapId(), oid, enerhe, Pos, oidpos, j, i, level, k));

                return;


            case 3:
                /* 3067 */
                cid = slea.readInt();
                /* 3068 */
                slea.readInt();
                /* 3069 */
                skillid = slea.readInt();

                /* 3071 */
                slea.skip(4);
                /* 3072 */
                s1 = slea.readInt();
                /* 3073 */
                s2 = slea.readInt();
                /* 3074 */
                c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.SummonEnergy2(Type, cid, c.getPlayer().getMapId(), s1, s2, skillid));

                return;


            case 4:
                /* 3078 */
                cid = slea.readInt();
                /* 3079 */
                par2 = slea.readShort();
                /* 3080 */
                slea.readShort();
                /* 3081 */
                par1 = slea.readShort();
                /* 3082 */
                par3 = slea.readShort();
                /* 3083 */
                point1 = slea.readPos();
                /* 3084 */
                skillId = slea.readInt();
                /* 3085 */
                dir = slea.readByte();
                /* 3086 */
                slea.skip(10);
                /* 3087 */
                Temporary1 = slea.readShort();
                /* 3088 */
                Temporary2 = slea.readShort();
                /* 3089 */
                Temporary3 = slea.readShort();
                /* 3090 */
                slea.readInt();
                /* 3091 */
                slea.readByte();
                /* 3092 */
                DirPos1 = slea.readInt();
                /* 3093 */
                DirPos2 = slea.readInt();
                /* 3094 */
                if (!c.getPlayer().isGM()) {
                    /* 3095 */
                    c.getPlayer().getMap().broadcastMessage(c.getPlayer(), BuffPacket.CannonPlateEffectFort(c.getPlayer(), par1, par2, par3, dir, Temporary1, Temporary2, Temporary3, skillId, DirPos1, DirPos2), false);

                }

                return;

        }



        /* 3102 */
        if (c.getPlayer().isGM()) {
            /* 3103 */
            c.getPlayer().dropMessage(-1, "找不到移动类型:" + Type);

        }
    }






    public static void SpawnArrowsTurret(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3110 */
        if (chr == null || chr.hasBlockedInventory()) {
            /* 3111 */
            c.announce(MaplePacketCreator.enableActions());

            return;

        }
        /* 3114 */
        byte side = slea.readByte();
        /* 3115 */
        Point pos = new Point(slea.readInt(), slea.readInt());

        /* 3117 */
        for (MapleArrowsTurret obj : chr.getMap().getAllArrowsTurrets()) {
            /* 3118 */
            if (obj.getOwnerId() == chr.getId()) {
                /* 3119 */
                chr.getMap().removeMapObject((MapleMapObject) obj);
                /* 3120 */
                chr.getMap().broadcastMessage(BuffPacket.cancelArrowsTurret(obj));

                break;

            }

        }
        /* 3124 */
        MapleArrowsTurret tospawn = new MapleArrowsTurret(chr, side, pos);
        /* 3125 */
        chr.getMap().spawnArrowsTurret(tospawn);

    }



    public static void showTrackFlames(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3129 */
        int linkskill = slea.readInt();
        /* 3130 */
        int skillLevel = chr.getTotalSkillLevel(linkskill);
        /* 3131 */
        Skill skill = SkillFactory.getSkill(linkskill);
        /* 3132 */
        MapleStatEffect effect = skill.getEffect(skillLevel);
        /* 3133 */
        if (effect == null) {
            /* 3134 */
            Skill.log.error("炎术士魔法攻击效果为空 玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skill.getId() + " - " + skill.getName() + " 技能等级: " + skillLevel);

            return;

        }
        /* 3137 */
        effect.applyTo(chr);
        /* 3138 */
        int[] skills = {12120007, 12110024, 12100026, 12000022};
        /* 3139 */
        for (int s : skills) {
            /* 3140 */
            skillLevel = chr.getTotalSkillLevel(s);
            /* 3141 */
            if (skillLevel > 0) {


                /* 3144 */
                skill = SkillFactory.getSkill(s);
                /* 3145 */
                effect = skill.getEffect(skillLevel);
                /* 3146 */
                if (effect != null) {
                    /* 3147 */
                    effect.applyTo(chr);
                    break;

                }

            }

        }
        /* 3151 */
        PlayerSpecialStats specialstats = chr.getSpecialStat();
        /* 3152 */
        specialstats.gainTrackFlmes();
        /* 3153 */
        switch (linkskill) {

            case 12001020:
                /* 3155 */
                linkskill = 12000026;

                break;

            case 12100020:
                /* 3158 */
                linkskill = 12100028;

                break;

            case 12110020:
                /* 3161 */
                linkskill = 12110028;

                break;

            case 12120006:
                /* 3164 */
                linkskill = 12120010;

                break;

        }
        /* 3167 */
        chr.getMap().broadcastMessage(ForcePacket.showTrackFlames(chr.getId(), linkskill, slea.readByte(), specialstats.getTrackFlmes(), 0, slea.readShort()));

    }



    public static void selectJaguar(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3171 */
        slea.skip(4);
        /* 3172 */
        int id = slea.readInt();
        /* 3173 */
        chr.getQuestNAdd(MapleQuest.getInstance(111112)).setCustomData(String.valueOf((id + 1) * 10));
        /* 3174 */
        c.announce(MaplePacketCreator.updateJaguar(chr));

    }



    public static void updateSoulEffect(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3178 */
        boolean open = (slea.readByte() == 1);
        /* 3179 */
        int questid = 26535;
        /* 3180 */
        MapleQuest q = MapleQuest.getInstance(questid);
        /* 3181 */
        if (q == null) {

            return;

        }
        /* 3184 */
        MapleQuestStatus status = chr.getQuestNAdd(q);
        /* 3185 */
        if (status.getCustomData() == null) {
            /* 3186 */
            status.setStatus((byte) 1);
            /* 3187 */
            status.setCustomData("effect=0");
            /* 3188 */
            chr.updateQuest(status, true);
            /* 3189 */
            open = false;

        } else {
            /* 3191 */
            String data = open ? "effect=1" : "effect=0";
            /* 3192 */
            status.setCustomData(data);
            /* 3193 */
            chr.updateInfoQuest(questid, data);

        }
        /* 3195 */
        chr.getMap().broadcastMessage(MaplePacketCreator.updateSoulEffect(chr.getId(), open));

    }



    public static void effectSwitch(LittleEndianAccessor slea, MapleClient c) {
        /* 3199 */
        int pos = slea.readInt();
        /* 3200 */
        c.getPlayer().updateEffectSwitch(pos);
        /* 3201 */
        if (!c.getPlayer().isHidden()) {
            /* 3202 */
            c.getPlayer().getMap().broadcastMessage(c.getPlayer(), EffectPacket.getEffectSwitch(c.getPlayer().getId(), c.getPlayer().getEffectSwitch()), true);

        } else {
            /* 3204 */
            c.getPlayer().getMap().broadcastGMMessage(c.getPlayer(), EffectPacket.getEffectSwitch(c.getPlayer().getId(), c.getPlayer().getEffectSwitch()), true);

        }
        /* 3206 */
        c.announce(MaplePacketCreator.enableActions());

    }



    public static void openSigin(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 3210 */
        int itemid = slea.readInt();

        /* 3212 */
        if (player.getSigninStatus() == null)
             {
            /* 3214 */
            player.initSigninStatus();

        }


        /* 3218 */
        int day = player.getSigninStatus().getDay();

        /* 3220 */
        MapleSignin.SiginRewardInfo sri = MapleSignin.getInstance().getSiginRewards().get(day);

        /* 3222 */
        if (sri == null || sri.getItemId() != itemid) {
            /* 3223 */
            player.dropMessage(1, "每日签到：无效的奖励。");
            /* 3224 */
            log.error("" + ((sri == null) ? "sri为null" : "sri载入正常") + "   " + ((sri.getItemId() != itemid) ? ("奖励的道具和读取的道具不一致  封包读取的道具:" + itemid + " 设置的奖励:" + sri.getItemId() + "") : "奖励道具正常") + "");
            /* 3225 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }

        /* 3230 */
        int time = ServerConfig.SIGN_TIME;

        /* 3232 */
        int nowtime = player.getOnlineTime() / 60000;

        /* 3234 */
        int lefttime = time - nowtime;
        /* 3235 */
        if (nowtime < time) {

            /* 3237 */
            player.dropMessage(1, "领取每日签到必须在线:" + time + "分钟以上. 你今天已经上线了:" + nowtime + "分钟. 还差" + lefttime + "分钟就可以领取今日的奖励啦");
            /* 3238 */
            c.announce(MaplePacketCreator.enableActions());


            return;

        }

        /* 3243 */
        if (player.haveSpaceForId(sri.getItemId())) {

            Item item=null;
            /* 3245 */
            MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
            /* 3246 */
            if (ItemConstants.getInventoryType(sri.getItemId()) == MapleInventoryType.EQUIP) {
                /* 3247 */
                Equip equip = ii.randomizeStats((Equip) ii.getEquipById(sri.getItemId()));

            } else {
                /* 3249 */
                item = new Item(sri.getItemId(), (short) 0, !c.getPlayer().isSuperGM() ? 1 : (short) sri.getQuantity(), (short) 0);

            }
            /* 3251 */
            if (sri.getExpiredate() > 0)
                 {
                /* 3253 */
                item.setExpiration(System.currentTimeMillis() + (sri.getExpiredate() * 24 * 60 * 60 * 1000));

            }

            /* 3256 */
            item.setGMLog(c.getPlayer().getName() + " 每日签到第" + day + "天");

            /* 3258 */
            MapleInventoryManipulator.addbyItem(player.getClient(), item);

            /* 3260 */
            c.announce(MaplePacketCreator.getShowItemGain(item.getItemId(), item.getQuantity(), true));

            /* 3262 */
            player.getSigninStatus().update();

            /* 3264 */
            player.updateInfoQuest(7, player.getSigninStatus().toString());

            /* 3266 */
            c.announce(SigninPacket.getSigninReward(itemid, 2));
            /* 3267 */
            c.announce(SigninPacket.getSigninReward(itemid, 0));

        } else {
            /* 3269 */
            c.getPlayer().dropMessage(1, "您的背包空间不足。");
            /* 3270 */
            c.announce(InventoryPacket.getInventoryFull());
            /* 3271 */
            c.announce(InventoryPacket.showItemUnavailable());

        }

    }




















    public static void spawnSpecial(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3293 */
        int oid = slea.readInt();
        /* 3294 */
        int skillid = slea.readInt();
        /* 3295 */
        if (skillid == 2100010) {
            /* 3296 */
            slea.skip(4);

        }
        /* 3298 */
        int total = slea.readShort();
        /* 3299 */
        for (int i = 0; i < total; i++) {
            /* 3300 */
            int x1 = slea.readInt();
            /* 3301 */
            int y1 = slea.readInt();
            /* 3302 */
            int x2 = slea.readInt();
            /* 3303 */
            int y2 = slea.readInt();
            /* 3304 */
            Rectangle bounds = new Rectangle(x1, y1 - 30, x2 - x1, y2 - y1 + 50);
            /* 3305 */
            MapleStatEffect skillEffect = chr.getSkillEffect(2100010);
            /* 3306 */
            MapleMist mist = new MapleMist(bounds, chr, SkillFactory.getSkill(skillid).getEffect(chr.getTotalSkillLevel(skillid)), chr.getPosition());
            /* 3307 */
            chr.getMap().spawnMist(mist, skillEffect.getDuration(), false);

        }

    }



    public static void showKSPsychicGrabHanlder(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3312 */
        int skillid = slea.readInt();
        /* 3313 */
        short skilllevel = slea.readShort();
        /* 3314 */
        slea.skip(8);

        /* 3316 */
        List<KSPsychicSkillEntry> infos = new LinkedList<>();
        /* 3317 */
        int count = (chr.getSkillLevel(142120000) > 0) ? 5 : 3;
        /* 3318 */
        for (int i = 0; i < count; i++) {
            /* 3319 */
            KSPsychicSkillEntry ksse = new KSPsychicSkillEntry();

            /* 3321 */
            slea.skip(1);
            /* 3322 */
            ksse.setOid(slea.readInt());
            /* 3323 */
            slea.skip(4);
            /* 3324 */
            ksse.setMobOid(slea.readInt());
            /* 3325 */
            ksse.setObjectid(slea.readShort());
            /* 3326 */
            slea.read(3);
            /* 3327 */
            ksse.setN1(slea.readInt());
            /* 3328 */
            ksse.setN2(slea.readInt());
            /* 3329 */
            ksse.setN3(slea.readInt());
            /* 3330 */
            ksse.setN4(slea.readInt());
            /* 3331 */
            infos.add(ksse);

        }

        /* 3334 */
        chr.getMap().addKSPsychicObject(chr.getId(), skillid, infos);

        /* 3336 */
        if (!infos.isEmpty()) {
            /* 3337 */
            chr.getMap().broadcastMessage(EffectPacket.showKSPsychicGrab(chr.getId(), skillid, skilllevel, infos), chr.getTruePosition());

        }
        /* 3339 */
        infos.clear();

    }



    public static void showKSPsychicAttackHanlder(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3343 */
        int skillid = slea.readInt();
        /* 3344 */
        short skilllevel = slea.readShort();
        /* 3345 */
        int n1 = slea.readInt();
        /* 3346 */
        int n2 = slea.readInt();
        /* 3347 */
        byte n3 = slea.readByte();
        /* 3348 */
        int n4 = slea.readInt();
        /* 3349 */
        int n5 = -1, n6 = -1;
        /* 3350 */
        if (n4 != 0) {
            /* 3351 */
            n5 = slea.readInt();
            /* 3352 */
            n6 = slea.readInt();

        }
        /* 3354 */
        int n7 = slea.readInt();
        /* 3355 */
        int n8 = slea.readInt();
        /* 3356 */
        short n9 = slea.readShort();
        /* 3357 */
        short n10 = slea.readShort();






        /* 3364 */
        if (chr.getSkillLevel(SkillConstants.getLinkedAttackSkill(skillid)) != skilllevel) {

            return;

        }
        /* 3367 */
        MapleStatEffect effect = SkillFactory.getSkill(skillid).getEffect(skilllevel);
        /* 3368 */
        int ppcon = effect.getPPCon();
        /* 3369 */
        if (ppcon > 0) {
            /* 3370 */
            chr.gainPP(-ppcon);

        }




        /* 3376 */
        chr.getMap().broadcastMessage(chr, EffectPacket.showKSPsychicAttack(chr.getId(), skillid, skilllevel, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10), false);

    }




    public static void showKSPsychicReleaseHanlder(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3381 */
        int skillid = slea.readInt();
        /* 3382 */
        int skilllevel = slea.readInt();
        /* 3383 */
        int moboid = slea.readInt();
        /* 3384 */
        int objectid = slea.readInt();

        /* 3386 */
        int oid = chr.getMap().removeKSPsychicObject(chr.getId(), skillid, (moboid != 0) ? moboid : objectid);
        /* 3387 */
        if (oid > 0) {
            /* 3388 */
            chr.getMap().broadcastMessage(EffectPacket.showKSPsychicRelease(chr.getId(), oid), chr.getTruePosition());

        }

    }



    public static void showGiveKSUltimate(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3393 */
        int mode = slea.readInt();
        /* 3394 */
        int type = slea.readInt();
        /* 3395 */
        slea.skip(4);
        /* 3396 */
        int oid = slea.readInt();
        /* 3397 */
        int skillid = slea.readInt();
        /* 3398 */
        short skilllevel = slea.readShort();
        /* 3399 */
        int n1 = slea.readInt();
        /* 3400 */
        byte n2 = slea.readByte();
        /* 3401 */
        short n3 = slea.readShort();
        /* 3402 */
        short n4 = slea.readShort();
        /* 3403 */
        short n5 = slea.readShort();
        /* 3404 */
        int n6 = slea.readInt();
        /* 3405 */
        int n7 = slea.readInt();
        /* 3406 */
        Skill skill = SkillFactory.getSkill(skillid);
        /* 3407 */
        if (skill == null) {

            return;

        }
        /* 3410 */
        MapleStatEffect effect = skill.getEffect(skilllevel);
        /* 3411 */
        int ppcon = effect.getPPCon();
        /* 3412 */
        if (ppcon > 0) {
            /* 3413 */
            if (chr.getSpecialStat().getPP() >= ppcon) {
                /* 3414 */
                chr.gainPP(-ppcon);

            } else {
                /* 3416 */
                chr.dropMessage(5, "施展技能所需的心魂点数不足。");

                return;

            }

        }
        /* 3420 */
        if (skillid == 142121005) {
            /* 3421 */
            chr.getMap().addKSUltimateSkill(chr.getId(), Math.abs(oid));

        }
        /* 3423 */
        chr.send_other(EffectPacket.showGiveKSUltimate(chr.getId(), mode, type, oid, skillid, skilllevel, n1, n2, n3, n4, n5, n6, n7), true);

    }



    public static void showAttackKSUltimate(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3427 */
        int oid = slea.readInt();
        /* 3428 */
        short type = slea.readShort();
        /* 3429 */
        int n6 = slea.readInt();
        /* 3430 */
        int n7 = slea.readInt();
        /* 3431 */
        if (chr.getMap().isKSUltimateSkill(chr.getId(), oid)) {
            /* 3432 */
            chr.gainPP(-1);

        }
        /* 3434 */
        chr.getMap().broadcastMessage(EffectPacket.showAttackKSUltimate(oid, type), chr.getTruePosition());

    }



    public static void showKSMonsterEffect(LittleEndianAccessor lea, MapleClient c, MapleCharacter chr) {
        /* 3438 */
        int skillid = lea.readInt();
        /* 3439 */
        short skilllevel = lea.readShort();
        /* 3440 */
        lea.skip(13);
        /* 3441 */
        short size = lea.readShort();
        /* 3442 */
        Skill skill = SkillFactory.getSkill(skillid);

        /* 3444 */
        if (skill != null && skillid != 400021008) {
            /* 3445 */
            MapleStatEffect effect = skill.getEffect(skilllevel);
            /* 3446 */
            if (effect != null) {
                /* 3447 */
                for (int i = 0; i < size; i++) {
                    /* 3448 */
                    MapleMonster monster = chr.getMap().getMonsterByOid(lea.readInt());
                    /* 3449 */
                    if (monster != null) {
                        /* 3450 */
                        monster.applyNewStatus(effect);

                    }

                }

            }

        }

    }



    public static void showCancelKSUltimate(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3458 */
        int oid = slea.readInt();
        /* 3459 */
        chr.getMap().removeKSUltimateSkill(chr.getId());
        /* 3460 */
        chr.getMap().broadcastMessage(EffectPacket.showCancelKSUltimate(chr.getId(), Math.abs(oid)), chr.getTruePosition());

    }



    public static void CP_PsychicOverRequest(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3464 */
        int unk01 = slea.readInt();
        /* 3465 */
        c.announce(EffectPacket.showAttackKSUltimate(unk01, unk01));

    }



    public static void selectChair(LittleEndianAccessor slea, MapleClient c, MapleCharacter chr) {
        /* 3469 */
        chr.dropMessage(1, "该功能暂未开放。");
        /* 3470 */
        c.announce(MaplePacketCreator.enableActions());

    }



    public static void startBattleStatistics(LittleEndianAccessor slea, MapleClient c) {
        /* 3474 */
        if (slea.readByte() == 1) {
            /* 3475 */
            c.announce(MaplePacketCreator.startBattleStatistics());

        }

    }



    public static void callFriends(LittleEndianAccessor lea, MapleClient c, MapleCharacter chr) {
        /* 3480 */
        lea.skip(1);
        /* 3481 */
        int skillid = lea.readInt();
        /* 3482 */
        if (skillid == 112111011) {
            /* 3483 */
            MapleParty party = chr.getParty();
            /* 3484 */
            if (party != null) {
                /* 3485 */
                party.getMembers().parallelStream().filter(p -> (p.isOnline() && p.getChannel() == chr.getClient().getChannel() && p.getMapid() != chr.getMapId())).forEach(m -> {

                    MapleCharacter member = ChannelServer.getCharacterById(m.getId());

                    if (member != null) {

                        member.changeMap(chr.getMap(), chr.getTruePosition());

                    }

                });

            }

        }

    }






















    public static void moveFamiliarHandler(byte unkType, short Packetlength, int movetype, short mode, int familiaroid, LittleEndianAccessor lea, MapleCharacter player) {
        /* 3515 */
        boolean more = (lea.available() < 125L);

        /* 3517 */
        byte unk = lea.readByte();
        /* 3518 */
        if (!more) {
            /* 3519 */
            lea.skip(1);

        }
        /* 3521 */
        int v169 = lea.readInt();
        /* 3522 */
        Point startPos = lea.readPos();
        /* 3523 */
        Point velPos = lea.readPos();
        /* 3524 */
        List<LifeMovementFragment> res = MovementParse.parseMovement(lea, 6);

        /* 3526 */
        if (player != null && res != null && player.getSummonedFamiliar() != null && res.size() > 0) {
            /* 3527 */
            if (lea.available() != 0L) {
                /* 3528 */
                MovementParse.log.error("怪怪移动错误 封包: " + lea.toString(true));


                return;

            }
            /* 3532 */
            startPos = player.getSummonedFamiliar().getPosition();
            /* 3533 */
            MovementParse.updatePosition(res, (AnimatedMapleMapObject) player.getSummonedFamiliar(), 0);
            /* 3534 */
            player.getSummonedFamiliar().updatePosition(res);
            /* 3535 */
            if (!player.isHidden())
                /* 3536 */
                player.getMap().broadcastMessage(player, FamiliarPacket.moveSummonedFamiliar(player.getId(), unkType, Packetlength, movetype, mode, familiaroid, unk, more, v169, startPos, velPos, res), player.getTruePosition());

        }
    }

    public static void useFamiliarCard(LittleEndianAccessor lea, MapleClient c, MapleCharacter player) {
        int familiaroid;
        short s2;
        int index, mfid1, familiarsid;
        short s1;
        int slot;
        short s3;
        int totalexp, mfid2, unk, fammiliarSumid;

        Item item1;

        int totalmeso;

        MonsterFamiliar mf1, mf;

        Item item;

        int familiarByItemID, size;

        MonsterFamiliar mf2, monsterFamiliar1;

        FamiliarCard fc;

        Map<Integer, Integer> hashMap;

        int meso;

        MonsterFamiliar monsterFamiliar2;

        int i;
        /* 3549 */
        if (player == null || player.getMap() == null) {

            return;

        }
        /* 3552 */
        byte unkType = lea.readByte();
        /* 3553 */
        short Packetlength = lea.readShort();
        /* 3554 */
        int movetype = lea.readInt();
        /* 3555 */
        short mode = lea.readShort();
        /* 3556 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /* 3557 */
        switch (mode) {

            case 1:
                /* 3559 */
                familiaroid = lea.readInt();
                /* 3560 */
                if (lea.available() != 4L || movetype == 5) {
                    /* 3561 */
                    moveFamiliarHandler(unkType, Packetlength, movetype, mode, familiaroid, lea, player);


                    break;

                }
                /* 3565 */
                player.removeFamiliar();

                /* 3567 */
                if (!player.getFamiliars().containsKey(Integer.valueOf(familiaroid))) {

                    break;

                }

                /* 3571 */
                player.spawnFamiliar((MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(familiaroid)));
                /* 3572 */
                player.setChanged_familiars(true);

                break;


            case 2:
                /* 3576 */
                if (lea.available() == 0L && movetype == 2) {
                    /* 3577 */
                    player.removeFamiliar();
                    /* 3578 */
                    player.setChanged_familiars(true);

                }

                break;


            case 3:
                /* 3583 */
                if (movetype == 5) {
                    /* 3584 */
                    lea.readInt();
                    /* 3585 */
                    int n6 = lea.readByte() / 2;
                    /* 3586 */
                    MonsterFamiliar monsterFamiliar = player.getSummonedFamiliar().getFamiliar();
                    /* 3587 */
                    HashMap<Integer, Integer> hashMap1 = new HashMap<>();
                    /* 3588 */
                    if (monsterFamiliar != null) {
                        /* 3589 */
                        int n = (int) player.getStat().getCurrentMaxBaseDamage();
                        byte b2;
                        /* 3590 */
                        for (b2 = 0; b2 < n6; b2 = (byte) (b2 + 1)) {
                            /* 3591 */
                            int moboid = lea.readInt();
                            /* 3592 */
                            MapleMonster mob = player.getMap().getMonsterByOid(moboid);
                            /* 3593 */
                            if (mob != null && mob.isAlive()) {
                                /* 3594 */
                                hashMap1.put(Integer.valueOf(moboid), Integer.valueOf((int) Math.min(player.getStat().getCurrentMaxBaseDamage() * monsterFamiliar.getPad() * Math.max(0.1D, (100 - mob.getStats().getPDRate())) / 100.0D, 9.9999999E7D)));

                            }

                        }
                        /* 3597 */
                        lea.readByte();
                        /* 3598 */
                        player.getMap().broadcastGMMessage(player, FamiliarPacket.attackFamiliar(player.getId(), unkType, movetype, mode, hashMap1), true);
                        /* 3599 */
                        for (Map.Entry<Integer, Integer> entry : hashMap1.entrySet()) {
                            /* 3600 */
                            MapleMonster monsterByOid = player.getMap().getMonsterByOid(((Integer) entry.getKey()).intValue());
                            /* 3601 */
                            if (monsterByOid != null) {
                                /* 3602 */
                                monsterByOid.damage(player, ((Integer) entry.getValue()).intValue(), true);

                            }

                        }

                    }

                    break;

                }
                /* 3608 */
                s2 = lea.readShort();
                /* 3609 */
                s3 = lea.readShort();

                /* 3611 */
                item1 = player.getInventory(MapleInventoryType.USE).getItem(s2);

                /* 3613 */
                if (item1 == null || item1.getFamiliarCard() == null) {

                    break;

                }

                /* 3617 */
                if (item1.getQuantity() < 1 || item1.getItemId() / 10000 != 287) {

                    /* 3619 */
                    c.announce(MaplePacketCreator.enableActions());


                    return;

                }
                /* 3623 */
                if (player.getFamiliars().size() >= 60) {
                    /* 3624 */
                    player.dropMessage(1, "怪怪图鉴数量已经达到最大值!");

                    /* 3626 */
                    c.announce(MaplePacketCreator.enableActions());


                    return;

                }
                /* 3630 */
                familiarByItemID = ItemConstants.getFamiliarByItemID(item1.getItemId());
                /* 3631 */
                fc = item1.getFamiliarCard();

                /* 3633 */
                if (fc.getOption1() > 0 || fc.getOption2() > 0 || fc.getOption3() > 0) {
                    /* 3634 */
                    monsterFamiliar2 = new MonsterFamiliar(player.getAIFamiliarID(), player.getId(), familiarByItemID, "", fc.getGrade(), fc.getLevel(), 0, fc.getSkill(), fc.getOption1(), fc.getOption2(), fc.getOption3(), false);

                } else {
                    /* 3636 */
                    monsterFamiliar2 = new MonsterFamiliar(player.getAIFamiliarID(), player.getId(), familiarByItemID, fc.getGrade());

                }




                /* 3642 */
                monsterFamiliar2.setIndex(player.getFamiliars().size() + 1);
                /* 3643 */
                player.addFamiliarsInfo(monsterFamiliar2);
                /* 3644 */
                MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, s2, (short) 1, false, false);

                /* 3646 */
                c.announce(FamiliarPacket.showAllFamiliar(player));

                break;


            case 7:
                /* 3650 */
                index = lea.readInt();

                /* 3652 */
                totalexp = 0;

                /* 3654 */
                totalmeso = 0;
                /* 3655 */
                lea.skip(4);

                /* 3657 */
                size = lea.readByte() / 2;

                /* 3659 */
                hashMap = new HashMap<>();

                /* 3661 */
                monsterFamiliar2 = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(index));
                /* 3662 */
                if (monsterFamiliar2 == null) {

                    break;

                }
                /* 3665 */
                for (i = 0; i < size; i++) {
                    /* 3666 */
                    int subindex = lea.readInt();
                    /* 3667 */
                    lea.skip(4);

                    /* 3669 */
                    MonsterFamiliar submf = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(subindex));
                    /* 3670 */
                    if (submf == null) {

                        return;

                    }

                    /* 3674 */
                    int grade = submf.getGrade();


                    /* 3677 */
                    int level = submf.getLevel();


                    /* 3680 */
                    int exps = 0;
                    /* 3681 */
                    switch (grade) {

                        case 4:
                            /* 3683 */
                            exps += 65;

                            break;

                        case 3:
                            /* 3686 */
                            exps += 35;

                            break;

                        case 2:
                            /* 3689 */
                            exps += 25;

                            break;

                        case 1:
                            /* 3692 */
                            exps += 15;

                            break;

                        case 0:
                            /* 3695 */
                            exps += 5;

                            break;

                    }

                    /* 3699 */
                    switch (level) {

                        case 5:
                            /* 3701 */
                            exps += 65;

                            break;

                        case 4:
                            /* 3704 */
                            exps += 35;

                            break;

                        case 3:
                            /* 3707 */
                            exps += 25;

                            break;

                        case 2:
                            /* 3710 */
                            exps += 15;

                            break;

                        case 1:
                            /* 3713 */
                            exps += 5;

                            break;

                    }
                    /* 3716 */
                    totalexp += exps;
                    /* 3717 */
                    hashMap.put(Integer.valueOf(subindex), Integer.valueOf(exps));
                    /* 3718 */
                    totalmeso += 50000 * (monsterFamiliar2.getGrade() + 1);

                }



                /* 3723 */
                if (player.getMeso() < totalmeso) {
                    /* 3724 */
                    player.dropMessage(1, "你的冒险币不够.");


                    break;

                }
                /* 3728 */
                for (Integer mfID : hashMap.keySet()) {
                    /* 3729 */
                    player.removeFamiliarsInfo(mfID.intValue());

                }

                /* 3732 */
                monsterFamiliar2.gainExp(totalexp);

                /* 3734 */
                player.gainMeso(-totalmeso, false);

                /* 3736 */
                c.announce(FamiliarPacket.StrengthenFamiliarCard(player.getId(), unkType, movetype, mode, hashMap));

                /* 3738 */
                c.announce(FamiliarPacket.showAllFamiliar(player));

                break;


            case 9:
                /* 3742 */
                mfid1 = lea.readInt();
                /* 3743 */
                lea.skip(4);
                /* 3744 */
                mfid2 = lea.readInt();
                /* 3745 */
                lea.skip(4);
                /* 3746 */
                if (!player.getFamiliars().containsKey(Integer.valueOf(mfid1)) || !player.getFamiliars().containsKey(Integer.valueOf(mfid2))) {

                    break;

                }
                /* 3749 */
                mf1 = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(mfid1));
                /* 3750 */
                mf2 = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(mfid2));
                /* 3751 */
                if (mf1 == null || mf2 == null) {

                    /* 3753 */
                    c.announce(MaplePacketCreator.enableActions());


                    return;

                }
                /* 3757 */
                meso = 50000 * (mf2.getGrade() + 1) * 2;
                /* 3758 */
                if (mf1.getGrade() == mf2.getGrade() && mf1.getLevel() == 5 && mf2.getLevel() == 5 && player.getMeso() >= meso) {

                    /* 3760 */
                    mf1.updateGrade();

                    /* 3762 */
                    player.removeFamiliarsInfo(mfid2);

                    /* 3764 */
                    player.gainMeso(-meso, true);

                    /* 3766 */
                    c.announce(FamiliarPacket.EvolutionFamiliarCard(player.getId(), unkType, movetype, mode));

                    /* 3768 */
                    c.announce(FamiliarPacket.showAllFamiliar(player));

                }

                break;


            case 10:
                /* 3773 */
                familiarsid = lea.readInt();
                /* 3774 */
                unk = lea.readInt();
                /* 3775 */
                if (!player.getFamiliars().containsKey(Integer.valueOf(familiarsid))) {

                    break;

                }
                /* 3778 */
                mf = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(familiarsid));
                /* 3779 */
                mf.setName(lea.readMapleAsciiString());
                /* 3780 */
                c.announce(FamiliarPacket.showAllFamiliar(player));

                break;


            case 13:
                /* 3784 */
                familiarsid = lea.readInt();
                /* 3785 */
                lea.skip(4);
                /* 3786 */
                if (player.getFamiliars().containsKey(Integer.valueOf(familiarsid))) {
                    /* 3787 */
                    player.removeFamiliarsInfo(familiarsid);
                    /* 3788 */
                    c.announce(FamiliarPacket.showAllFamiliar(player));

                }

                break;


            case 14:
                /* 3793 */
                s1 = lea.readShort();
                /* 3794 */
                lea.skip(2);
                /* 3795 */
                fammiliarSumid = lea.readInt();
                /* 3796 */
                item = player.getInventory(MapleInventoryType.CASH).getItem(s1);
                /* 3797 */
                if (item == null || item.getItemId() != 5743003) {

                    /* 3799 */
                    c.announce(MaplePacketCreator.enableActions());

                    break;

                }
                /* 3802 */
                if (!player.haveItem(4009453, 1)) {
                    /* 3803 */
                    player.dropMessage(5, "为了激活魔方需要有一个魔方精髓！");


                    return;

                }

                /* 3808 */
                monsterFamiliar1 = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(fammiliarSumid));

                /* 3810 */
                monsterFamiliar1.initOptions();

                /* 3812 */
                MapleInventoryManipulator.removeById(c, MapleInventoryType.ETC, 4009453, 1, false, false);

                /* 3814 */
                MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, s1, (short) 1, false, false);

                /* 3816 */
                player.setChanged_familiars(true);

                /* 3818 */
                c.announce(FamiliarPacket.showAllFamiliar(player));
                /* 3819 */
                c.sendEnableActions();

                break;


            case 16:
                /* 3823 */
                slot = lea.readInt();
                /* 3824 */
                c.announce(FamiliarPacket.ShowFamiliarSolt(player, slot));

                break;

        }
    }












    public static void sealFamiliar(LittleEndianAccessor lea, MapleClient c, MapleCharacter player) {
        /* 3838 */
        int oid = lea.readInt();
        /* 3839 */
        lea.skip(20);
        /* 3840 */
        byte nxtype = lea.readByte();
        /* 3841 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /* 3842 */
        if (player.getFamiliars().containsKey(Integer.valueOf(oid))) {
            /* 3843 */
            if (player.getSpace(2) < 1) {
                /* 3844 */
                player.dropMessage(1, "消耗栏空间不足!");
                /* 3845 */
                c.sendEnableActions();

                return;

            }
            /* 3848 */
            if (player.getCSPoints(nxtype) < 5000) {
                /* 3849 */
                player.dropMessage(1, "没有足够的点卷!");
                /* 3850 */
                c.sendEnableActions();

                return;

            }
            /* 3853 */
            player.modifyCSPoints(nxtype, -5000);
            /* 3854 */
            MonsterFamiliar familiar = (MonsterFamiliar) player.getFamiliars().get(Integer.valueOf(oid));
            /* 3855 */
            if (familiar != null) {
                /* 3856 */
                player.removeFamiliarsInfo(oid);
                /* 3857 */
                int monsterCardID = ii.getFamiliar(familiar.getFamiliar()).getMonsterCardID();
                /* 3858 */
                Item card = new Item(monsterCardID, (short) 0, (short) 1);
                /* 3859 */
                card.setFamiliarCard(familiar.createFamiliarCard());
                /* 3860 */
                MapleInventoryManipulator.addbyItem(c, card, false);
                /* 3861 */
                c.announce(FamiliarPacket.showAllFamiliar(player));

            }
            /* 3863 */
            c.sendEnableActions();

        }

    }




    public static void UseTowerChairSetting(LittleEndianAccessor lea, MapleClient c, MapleCharacter player) {
        /* 3869 */
        lea.skip(4);
        /* 3870 */
        for (int i2 = 0; i2 < 6; i2++) {
            /* 3871 */
            int n2 = lea.readInt();
            /* 3872 */
            if (player.haveItem(n2)) {
                /* 3873 */
                player.updateOneInfo(7266, String.valueOf(i2), String.valueOf(n2));

            } else {

                /* 3876 */
                player.updateOneInfo(7266, String.valueOf(i2), "0");

            }
            /* 3878 */
        }
        player.getClient().announce(MaplePacketCreator.useTowerChairSetting());

    }













































    public static void DamageSkinOp(LittleEndianAccessor lea, MapleCharacter player) {

        short s;

        int skinId;

        List<Integer> damSkinList;

        int i;

        StringBuilder sb;
        /* 3929 */
        byte type = lea.readByte();
        /* 3930 */
        switch (type) {

            case 0:
                /* 3932 */
                if (player.getDamSkinList().size() < Integer.valueOf(player.getKeyValue("DAMAGE_SKIN_SLOT")).intValue() && !player.getDamSkinList().contains(Integer.valueOf(player.getDamageSkin()))) {
                    /* 3933 */
                    player.getDamSkinList().add(Integer.valueOf(player.getDamageSkin()));
                    /* 3934 */
                    StringBuilder stringBuilder = new StringBuilder();
                    /* 3935 */
                    for (Integer integer : player.getDamSkinList()) {
                        /* 3936 */
                        stringBuilder.append(integer).append(",");
                        /* 3937 */
                        player.setKeyValue("DAMAGE_SKIN", stringBuilder.toString().substring(0, stringBuilder.toString().length() - 1));
                        /* 3938 */
                        player.send(MaplePacketCreator.updateDamageSkin(player, 0));

                    }

                } else {
                    /* 3941 */
                    player.dropMessage(1, "保存伤害皮肤出错!");
                    /* 3942 */
                    player.send(MaplePacketCreator.enableActions());

                }

                return;



            case 1:
                /* 3948 */
                s = lea.readShort();
                /* 3949 */
                damSkinList = player.getDamSkinList();
                /* 3950 */
                for (i = 0; i < damSkinList.size(); i++) {
                    /* 3951 */
                    if (((Integer) damSkinList.get(i)).intValue() == s) {
                        /* 3952 */
                        damSkinList.remove(i);

                    }

                }
                /* 3955 */
                sb = new StringBuilder();
                /* 3956 */
                for (Integer integer : damSkinList) {
                    /* 3957 */
                    sb.append(integer).append(",");
                    /* 3958 */
                    player.setKeyValue("DAMAGE_SKIN", (sb.toString().length() > 0) ? sb.toString().substring(0, sb.toString().length() - 1) : "");
                    /* 3959 */
                    player.send(MaplePacketCreator.updateDamageSkin(player, 1));

                }

                return;



            case 2:
                /* 3965 */
                skinId = lea.readShort();
                /* 3966 */
                if (player.getDamSkinList().contains(Integer.valueOf(skinId))) {
                    /* 3967 */
                    if (player.getMeso() >= 500000L) {
                        /* 3968 */
                        player.gainMeso(-500000L, true);
                        /* 3969 */
                        player.changeDamageSkin(skinId);

                    } else {

                        /* 3972 */
                        player.dropMessage(1, "请确认你有 500,000 金币!");
                        /* 3973 */
                        player.send(MaplePacketCreator.enableActions());

                    }

                } else {
                    /* 3976 */
                    player.dropMessage(1, "伤害皮肤应用出错!你并没有这个伤害皮肤!");
                    /* 3977 */
                    player.send(MaplePacketCreator.enableActions());

                }

                return;

        }


        /* 3983 */
        System.err.println("未处理的伤害皮肤操作,type为:" + type);
    }

    public static void VCoreOperation(LittleEndianAccessor lea, MapleCharacter player) {
        int j, expEnforce, i, n22, vcoreoid, int11, int12, unk;
        VCoreSkillEntry vCoreSkillEntry1;
        int vcoreid;
        VCoreSkillEntry vcoreskill;
        int n23;
        VCoreDataEntry vcoredata;
        VMatrixSlotEntry k6;
        int n27, solt, vcoresize, i7, type;

        VMatrixSlotEntry k7;

        int index;

        VCoreSkillEntry vCoreSkillEntry2;

        int needCore, opType;

        String oneInfo;

        VCoreSkillEntry vCoreSkillEntry3;
        /* 3990 */
        int count, action = lea.readInt();
        /* 3991 */
        MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
        /* 3992 */
        VCoreOpcode mode = VCoreOpcode.getByAction(action);
        /* 3993 */
        if (player == null || mode == null) {
            /* 3994 */
            if (ServerConstants.isShowPacket()) {
                /* 3995 */
                System.out.println("V矩阵未知的操作类型: 0x" + StringUtil.getLeftPaddedStr(Integer.toHexString(action).toUpperCase(), '0', 2) + " " + lea.toString());

            }
            /* 3997 */
            player.sendEnableActions();


            return;

        }
        /* 4001 */
        switch (mode) {

            case 装备核心:
                /* 4003 */
                j = lea.readInt();
                /* 4004 */
                unk = lea.readInt();
                /* 4005 */
                solt = lea.readInt();
                /* 4006 */
                index = lea.readInt();
                /* 4007 */
                opType = lea.readByte();
                /* 4008 */
                vCoreSkillEntry3 = (VCoreSkillEntry) player.getVCoreSkill().get(Integer.valueOf(j));
                /* 4009 */
                if (vCoreSkillEntry3 != null && vCoreSkillEntry3.getSlot() == 1 && vCoreSkillEntry3.getSlot() != 2) {


                    /* 4012 */
                    if (player.checkVCoreSkill(vCoreSkillEntry3.getSkill(1))) {
                        /* 4013 */
                        player.sendEnableActions();

                        return;

                    }
                    /* 4016 */
                    if (index < 0 && (index = player.getNextVMatrixSlot()) < 0) {
                        /* 4017 */
                        player.sendEnableActions();


                        return;

                    }
                    /* 4021 */
                    VMatrixSlotEntry vMatrixSlotEntry = (VMatrixSlotEntry) player.getVMatrixSlot().get(Integer.valueOf(index));
                    /* 4022 */
                    int n2 = (player.getLevel() - 200) / 5 + VMatrixOptionBans.INSTANCE.getEquipSlotMin();
                    /* 4023 */
                    int n3 = index - (player.getLevel() - 200) / 5 - VMatrixOptionBans.INSTANCE.getEquipSlotMin();
                    /* 4024 */
                    int k = ((index < n2) ? 1 : 0) | ((index >= n2 && n3 >= 0 && n3 <= 1 && index < VMatrixOptionBans.INSTANCE.getEquipSlotMax()) ? 1 : 0);

                    /* 4026 */
                    if (k == 0 || vMatrixSlotEntry == null) {
                        /* 4027 */
                        player.sendEnableActions();


                        return;

                    }
                    /* 4031 */
                    if (k == 0 || index < n2 || vMatrixSlotEntry.getUnlock() == 1) {
                        /* 4032 */
                        vCoreSkillEntry3.setIndex(index);
                        /* 4033 */
                        player.setVCoreSkillSlot(j, 2);
                        /* 4034 */
                        vMatrixSlotEntry.setIndex(j);
                        /* 4035 */
                        int extend = vMatrixSlotEntry.getExtend();
                        /* 4036 */
                        for (int i2 = 1; i2 <= 3; i2++) {
                            /* 4037 */
                            if (vCoreSkillEntry3.getSkill(i2) > 0) {
                                /* 4038 */
                                player.changeSingleSkillLevel(vCoreSkillEntry3.getSkill(i2), player.getVCoreSkillLevel(vCoreSkillEntry3.getSkill(i2)) + extend, (byte) ((vCoreSkillEntry3.getType() == 2) ? 1 : ((vCoreSkillEntry3.getType() == 0) ? 25 : 50)));
                                /* 4039 */
                                if (vCoreSkillEntry3.getSkill(i2) == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                    /* 4040 */
                                    player.changeSingleSkillLevel(400051001, player.getVCoreSkillLevel(vCoreSkillEntry3.getSkill(i2)) + extend, (byte) ((vCoreSkillEntry3.getType() == 2) ? 1 : ((vCoreSkillEntry3.getType() == 0) ? 25 : 50)));

                                }

                            }

                        }
                        /* 4044 */
                        player.send(VCorePacket.INSTANCE.updateVCoreList(player, true, 0, j));

                    }
                    return;

                }

                return;

            case 卸下核心:
                /* 4049 */
                j = lea.readInt();
                /* 4050 */
                lea.readInt();
                /* 4051 */
                vCoreSkillEntry1 = (VCoreSkillEntry) player.getVCoreSkill().get(Integer.valueOf(j));
                /* 4052 */
                if (vCoreSkillEntry1 != null && vCoreSkillEntry1.getSlot() == 2) {

                    /* 4054 */
                    player.setVCoreSkillSlot(j, 1);
                    /* 4055 */
                    VMatrixSlotEntry vMatrixSlotEntry = (VMatrixSlotEntry) player.getVMatrixSlot().get(Integer.valueOf(vCoreSkillEntry1.getIndex()));
                    /* 4056 */
                    if (vMatrixSlotEntry != null && vMatrixSlotEntry.getIndex() == j) {
                        /* 4057 */
                        vMatrixSlotEntry.setIndex(-1);
                        /* 4058 */
                        for (int i3 = 1; i3 <= 3; i3++) {
                            /* 4059 */
                            if (vCoreSkillEntry1.getSkill(i3) > 0) {
                                /* 4060 */
                                int vCoreSkillLevel = player.getVCoreSkillLevel(vCoreSkillEntry1.getSkill(i3));
                                /* 4061 */
                                player.changeSingleSkillLevel(vCoreSkillEntry1.getSkill(i3), (vCoreSkillLevel > 0) ? vCoreSkillLevel : -1, (byte) ((vCoreSkillEntry1.getType() == 2) ? 1 : ((vCoreSkillEntry1.getType() == 0) ? 25 : 50)), -1L);
                                /* 4062 */
                                if (vCoreSkillEntry1.getSkill(i3) == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                    /* 4063 */
                                    player.changeSingleSkillLevel(400051001, (vCoreSkillLevel > 0) ? vCoreSkillLevel : -1, (byte) ((vCoreSkillEntry1.getType() == 2) ? 1 : ((vCoreSkillEntry1.getType() == 0) ? 25 : 50)), -1L);

                                }

                            }

                        }
                        /* 4067 */
                        player.send(VCorePacket.INSTANCE.updateVCoreList(player, true, 1, j));

                        return;

                    }
                    /* 4070 */
                    player.sendEnableActions();

                }

                return;

            case 强化核心:
                /* 4074 */
                expEnforce = 0;
                /* 4075 */
                vcoreid = lea.readInt();
                /* 4076 */
                vcoresize = lea.readInt();
                /* 4077 */
                vCoreSkillEntry2 = (VCoreSkillEntry) player.getVCoreSkill().get(Integer.valueOf(vcoreid));
                /* 4078 */
                if (vCoreSkillEntry2 != null && vCoreSkillEntry2.getSlot() > 0) {
                    /* 4079 */
                    int currLevel = vCoreSkillEntry2.getLevel();
                    /* 4080 */
                    for (int k = 1; k <= vcoresize; k++) {
                        /* 4081 */
                        int n9 = lea.readInt();
                        /* 4082 */
                        VCoreSkillEntry vcoreskill2 = (VCoreSkillEntry) player.getVCoreSkill().get(Integer.valueOf(n9));
                        /* 4083 */
                        if (vcoreskill2 != null && vcoreskill2.getSlot() > 0 && vcoreskill2.getSlot() != 2) {
                            /* 4084 */
                            Triple<Integer, Integer, Integer> w2 = (Triple<Integer, Integer, Integer>) ii.getVcores(vCoreSkillEntry2.getType()).get(Integer.valueOf(vCoreSkillEntry2.getLevel()));
                            /* 4085 */
                            Triple<Integer, Integer, Integer> w3 = (Triple<Integer, Integer, Integer>) ii.getVcores(vcoreskill2.getType()).get(Integer.valueOf(vcoreskill2.getLevel()));
                            /* 4086 */
                            int n10 = ((Integer) w3.getMid()).intValue();
                            /* 4087 */
                            int oldLevel = vCoreSkillEntry2.getLevel();
                            /* 4088 */
                            if (oldLevel < 25) {
                                /* 4089 */
                                if (player.isAdmin()) {
                                    /* 4090 */
                                    vCoreSkillEntry2.setLevel(25);

                                } else {
                                    /* 4092 */
                                    vCoreSkillEntry2.gainExp(n10);
                                    /* 4093 */
                                    expEnforce += n10;
                                    /* 4094 */
                                    if (vCoreSkillEntry2.getExp() >= ((Integer) w2.getLeft()).intValue()) {
                                        /* 4095 */
                                        vCoreSkillEntry2.levelUP();
                                        /* 4096 */
                                        vCoreSkillEntry2.setExp(vCoreSkillEntry2.getExp() - ((Integer) w2.getLeft()).intValue());

                                    }

                                }
                                /* 4099 */
                                for (int i5 = 1; i5 <= 3; i5++) {
                                    /* 4100 */
                                    if (vCoreSkillEntry2.getSkill(i5) > 0) {
                                        /* 4101 */
                                        player.changeSingleSkillLevel(vCoreSkillEntry2.getSkill(i5), player.getVCoreSkillLevel(vCoreSkillEntry2.getSkill(i5)), (byte) ((vCoreSkillEntry2.getType() == 2) ? 1 : ((vCoreSkillEntry2.getType() == 0) ? 25 : 50)));
                                        /* 4102 */
                                        if (vCoreSkillEntry2.getSkill(i5) == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                            /* 4103 */
                                            player.changeSingleSkillLevel(400051001, player.getVCoreSkillLevel(vCoreSkillEntry2.getSkill(i5)), (byte) ((vCoreSkillEntry2.getType() == 2) ? 1 : ((vCoreSkillEntry2.getType() == 0) ? 25 : 50)));

                                        }

                                    }

                                }
                                /* 4107 */
                                player.setVCoreSkillSlot(n9, 0);

                            } else {
                                /* 4109 */
                                player.dropMessage(1, "最多可强化到25级！");

                            }

                        }

                    }
                    /* 4113 */
                    player.send(VCorePacket.INSTANCE.showVCoreSkillExpResult(vcoreid, expEnforce, currLevel, vCoreSkillEntry2.getLevel()));

                }
                /* 4115 */
                player.send(VCorePacket.INSTANCE.updateVCoreList(player, true, 3, 0));

                return;


            case 分解核心:
                /* 4119 */
                i = lea.readInt();
                /* 4120 */
                vcoreskill = (VCoreSkillEntry) player.getVCoreSkill().get(Integer.valueOf(i));
                /* 4121 */
                if (vcoreskill != null && vcoreskill.getSlot() > 0) {
                    /* 4122 */
                    player.removeVCoreSkill(i);
                    /* 4123 */
                    for (int i5 = 1; i5 <= 3; i5++) {
                        /* 4124 */
                        int vCoreSkillID = vcoreskill.getSkill(i5);
                        /* 4125 */
                        if (vCoreSkillID > 0) {
                            /* 4126 */
                            player.changeSingleSkillLevel(vCoreSkillID, (player.getVCoreSkillLevel(vCoreSkillID) > 0) ? player.getVCoreSkillLevel(vCoreSkillID) : -1, (byte) ((vcoreskill.getType() == 2) ? 1 : ((vcoreskill.getType() == 0) ? 25 : 50)));
                            /* 4127 */
                            if (vCoreSkillID == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                /* 4128 */
                                player.changeSingleSkillLevel(400051001, (player.getVCoreSkillLevel(vCoreSkillID) > 0) ? player.getVCoreSkillLevel(vCoreSkillID) : -1, (byte) ((vcoreskill.getType() == 2) ? 1 : ((vcoreskill.getType() == 0) ? 25 : 50)));

                            }

                        }

                    }
                    /* 4132 */
                    Triple<Integer, Integer, Integer> triple = (Triple<Integer, Integer, Integer>) ii.getVcores(vcoreskill.getType()).get(Integer.valueOf(vcoreskill.getLevel()));
                    /* 4133 */
                    player.gainVCraftCore(((Integer) triple.getRight()).intValue());
                    /* 4134 */
                    player.send(VCorePacket.INSTANCE.updateVCoreList(player, true, 5, 0));
                    /* 4135 */
                    player.send(VCorePacket.INSTANCE.addVCorePieceResult(((Integer) triple.getRight()).intValue()));

                    return;

                }

                return;


            case 分解核心列表:
                /* 4141 */
                n22 = lea.readInt();
                /* 4142 */
                n23 = 0;
                /* 4143 */
                for (i7 = 0; i7 < n22; i7++) {
                    /* 4144 */
                    int k = lea.readInt();
                    /* 4145 */
                    VCoreSkillEntry vCoreSkillEntry = (VCoreSkillEntry) player.getVCoreSkill().get(Integer.valueOf(k));
                    /* 4146 */
                    if (vCoreSkillEntry != null && vCoreSkillEntry.getSlot() > 0) {
                        /* 4147 */
                        player.removeVCoreSkill(k);
                        /* 4148 */
                        for (int i8 = 1; i8 <= 3; i8++) {
                            /* 4149 */
                            int vCoreSkillID = vCoreSkillEntry.getSkill(i8);
                            /* 4150 */
                            if (vCoreSkillID > 0) {
                                /* 4151 */
                                player.changeSingleSkillLevel(vCoreSkillID, (player.getVCoreSkillLevel(vCoreSkillID) > 0) ? player.getVCoreSkillLevel(vCoreSkillID) : -1, (byte) ((vCoreSkillEntry.getType() == 2) ? 1 : ((vCoreSkillEntry.getType() == 0) ? 25 : 50)));
                                /* 4152 */
                                if (vCoreSkillEntry.getSkill(i7) == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                    /* 4153 */
                                    player.changeSingleSkillLevel(400051001, (player.getVCoreSkillLevel(vCoreSkillID) > 0) ? player.getVCoreSkillLevel(vCoreSkillID) : -1, (byte) ((vCoreSkillEntry.getType() == 2) ? 1 : ((vCoreSkillEntry.getType() == 0) ? 25 : 50)));

                                }

                            }

                        }
                        /* 4157 */
                        Triple<Integer, Integer, Integer> triple = (Triple<Integer, Integer, Integer>) ii.getVcores(vCoreSkillEntry.getType()).get(Integer.valueOf(vCoreSkillEntry.getLevel()));
                        /* 4158 */
                        n23 += ((Integer) triple.right).intValue();

                    }

                }
                /* 4161 */
                player.gainVCraftCore(n23);
                /* 4162 */
                player.send(VCorePacket.INSTANCE.updateVCoreList(player, true, 5, 0));
                /* 4163 */
                player.send(VCorePacket.INSTANCE.addVCorePieceResult(n23));

                return;


            case 制作核心:
                /* 4167 */
                vcoreoid = lea.readInt();
                /* 4168 */
                vcoredata = ii.getVCoreData(vcoreoid);
                /* 4169 */
                type = vcoredata.getType();
                /* 4170 */
                needCore = (type == 0) ? 140 : ((type == 1) ? 70 : 250);
                /* 4171 */
                if (player.isAdmin()) {
                    /* 4172 */
                    player.dropMessage(5, "V核心ID：" + vcoreoid + " 需要：" + needCore + "个核心碎片。");

                }
                /* 4174 */
                oneInfo = player.getOneInfo(1477, "count");
                /* 4175 */
                if (oneInfo == null) {

                    return;

                }
                /* 4178 */
                count = Integer.valueOf(oneInfo).intValue();
                /* 4179 */
                if (count >= needCore) {
                    /* 4180 */
                    player.gainVCraftCore(-needCore);
                    /* 4181 */
                    int skill1 = 0;
                    /* 4182 */
                    int skill2 = 0;
                    /* 4183 */
                    int skill3 = 0;
                    /* 4184 */
                    if (vcoredata.getConnectSkill().size() > 0) {
                        /* 4185 */
                        skill1 = ((Integer) vcoredata.getConnectSkill().get(0)).intValue();

                    }
                    /* 4187 */
                    if (type == 1) {
                        /* 4188 */
                        List<VCoreDataEntry> list = ii.getVCoreDatasByJob(String.valueOf(player.getJob()));
                        /* 4189 */
                        Collections.shuffle(list);
                        /* 4190 */
                        if (list.size() > 0)
                            /* 4191 */ while (skill2 == 0 || skill3 == 0) {
                            /* 4192 */
                            VCoreDataEntry ay3 = list.get(Randomizer.nextInt(list.size()));
                            /* 4193 */
                            ArrayList<Integer> connectSkill = ay3.getConnectSkill();
                            /* 4194 */
                            if (connectSkill.size() > 0 && ((Integer) connectSkill.get(0)).intValue() != skill2) {
                                if ((((((Integer) connectSkill.get(0)).intValue() != skill1) ? 1 : 0) & ((((Integer) connectSkill.get(0)).intValue() != skill3) ? 1 : 0)) == 0)
                                     continue;
                                /* 4196 */
                                if (skill2 == 0) {
                                    /* 4197 */
                                    skill2 = ((Integer) connectSkill.get(0)).intValue();

                                    continue;

                                }
                                /* 4200 */
                                if (skill3 != 0)
                                     continue;
                                /* 4202 */
                                skill3 = ((Integer) connectSkill.get(0)).intValue();
                            }


                        }

                    }
                    /* 4206 */
                    player.addVCoreSkill(new VCoreSkillEntry(vcoreoid, 1, 0, skill1, skill2, skill3, -1L, 1, -1));
                    /* 4207 */
                    player.send(VCorePacket.INSTANCE.updateVCoreList(player, false, 0, 0));
                    /* 4208 */
                    player.send(VCorePacket.INSTANCE.addVCoreSkillResult(vcoreoid, 1, skill1, skill2, skill3));

                    return;

                }


            case 栏位增强:
                /* 4213 */
                int11 = lea.readInt();

                /* 4215 */
                if ((k6 = (VMatrixSlotEntry) player.getVMatrixSlot().get(Integer.valueOf(int11))) != null && k6.getExtend() < VMatrixOptionBans.INSTANCE.getEquipSlotEnhanceMax()) {
                    /* 4216 */
                    if (player.getVMatrixPoint() > 0) {
                        /* 4217 */
                        player.gainVCraftCore(-VMatrixOptionBans.INSTANCE.getCraftEnchantCoreCost());
                        /* 4218 */
                        k6.setExtend(Math.min(k6.getExtend() + 1, VMatrixOptionBans.INSTANCE.getEquipSlotEnhanceMax()));
                        /* 4219 */
                        player.setChanged_vcores(true);
                        /* 4220 */
                        Iterator<VCoreSkillEntry> iterator = player.getVCoreSkill().values().iterator();
                        /* 4221 */
                        while (iterator.hasNext()) {
                            /* 4222 */
                            VCoreSkillEntry i6 = iterator.next();
                            /* 4223 */
                            if (i6.getSlot() == 2 && i6.getIndex() == int11) {
                                /* 4224 */
                                int mo3 = k6.getExtend();
                                /* 4225 */
                                for (int slot = 1; slot <= 3; slot++) {
                                    /* 4226 */
                                    int vCoreSkillID = i6.getSkill(slot);
                                    /* 4227 */
                                    if (vCoreSkillID > 0) {
                                        /* 4228 */
                                        player.changeSingleSkillLevel(vCoreSkillID, player.getVCoreSkillLevel(vCoreSkillID) + mo3, (byte) ((i6.getType() == 2) ? 1 : ((i6.getType() == 0) ? 25 : 50)), -1L);
                                        /* 4229 */
                                        if (vCoreSkillID == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                            /* 4230 */
                                            player.changeSingleSkillLevel(400051001, player.getVCoreSkillLevel(vCoreSkillID) + mo3, (byte) ((i6.getType() == 2) ? 1 : ((i6.getType() == 0) ? 25 : 50)), -1L);

                                        }

                                    }

                                }

                                break;

                            }

                        }

                    } else {
                        /* 4238 */
                        player.dropMessage("矩阵点数不足。");

                    }
                    /* 4240 */
                    player.send(VCorePacket.INSTANCE.updateVCoreList(player, false, 0, 0));

                    return;

                }
                /* 4243 */
                player.sendEnableActions();


            case 扩展栏位:
                /* 4246 */
                int12 = lea.readInt();
                /* 4247 */
                lea.readInt();

                /* 4249 */
                if ((n27 = int12 - (player.getLevel() - 200) / 5 - VMatrixOptionBans.INSTANCE.getEquipSlotMin()) < 0 || n27 > 1 || int12 >= VMatrixOptionBans.INSTANCE.getEquipSlotMax()) {

                    return;

                }

                /* 4253 */
                if ((k7 = (VMatrixSlotEntry) player.getVMatrixSlot().get(Integer.valueOf(int12))) != null) {

                    Map<Integer, Integer> map;
                    /* 4255 */
                    if (k7.getUnlock() != 1 && (map = (Map<Integer, Integer>) VMatrixOptionBans.INSTANCE.getSlotExpansionMesos().get(Integer.valueOf(player.getLevel()))) != null && map.containsKey(Integer.valueOf(n27))) {
                        /* 4256 */
                        player.gainMeso(-((Integer) map.get(Integer.valueOf(n27))).intValue(), false);
                        /* 4257 */
                        k7.setUnlock(1);
                        /* 4258 */
                        player.setChanged_vcores(true);

                    }
                    /* 4260 */
                    player.send(VCorePacket.INSTANCE.updateVCoreList(player, false, 0, 0));

                    return;

                }
                /* 4263 */
                player.sendEnableActions();


            case 初始化栏位:
                /* 4266 */
                if (player.getMeso() >= VMatrixOptionBans.INSTANCE.getMatrixPointResetMeso()) {
                    /* 4267 */
                    player.gainMeso(-VMatrixOptionBans.INSTANCE.getMatrixPointResetMeso(), false);
                    /* 4268 */
                    player.getVMatrixSlot().values().forEach(k -> k.setExtend(0));
                    /* 4269 */
                    Iterator<VCoreSkillEntry> iterator2 = player.getVCoreSkill().values().iterator();
                    /* 4270 */
                    while (iterator2.hasNext()) {
                        /* 4271 */
                        VCoreSkillEntry vcse = iterator2.next();
                        /* 4272 */
                        if (vcse.getSlot() == 2) {
                            /* 4273 */
                            for (int slot = 1; slot <= 3; slot++) {
                                /* 4274 */
                                int vCoreSkillID = vcse.getSkill(slot);
                                /* 4275 */
                                if (vCoreSkillID > 0) {
                                    /* 4276 */
                                    player.changeSingleSkillLevel(vCoreSkillID, player.getVCoreSkillLevel(vCoreSkillID), (byte) ((vcse.getType() == 2) ? 1 : ((vcse.getType() == 0) ? 25 : 50)), -1L);
                                    /* 4277 */
                                    if (vCoreSkillID == 400051000 && (JobConstants.is尖兵(player.getJob()) || JobConstants.is隐月(player.getJob()) || JobConstants.is爆莉萌天使(player.getJob()) || JobConstants.is龙的传人(player.getJob()) || JobConstants.is奇袭者(player.getJob()))) {
                                        /* 4278 */
                                        player.changeSingleSkillLevel(400051001, player.getVCoreSkillLevel(vCoreSkillID), (byte) ((vcse.getType() == 2) ? 1 : ((vcse.getType() == 0) ? 25 : 50)), -1L);

                                    }

                                }

                            }

                        }

                    }
                    /* 4284 */
                    player.setChanged_vcores(true);

                }
                /* 4286 */
                player.send(VCorePacket.INSTANCE.updateVCoreList(player, false, 0, 0));

                break;

        }
        /* 4289 */
        System.err.println("未知V矩阵操作：" + mode);
    }








    public static void VmatrixHelpRequest(LittleEndianAccessor lea, MapleCharacter player) {
    }






    public static void VmatrixwindowRequest(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4302 */
        int mode = lea.readInt();
        /* 4303 */
        if (mode == 0) {
            /* 4304 */
            player.send(VCorePacket.INSTANCE.openVCoreWindow());

        }

    }







    public static void MicroBuffEndTime(LittleEndianAccessor lea, MapleCharacter player) {
    }







    public static void UseActivateDamageSkin(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4319 */
        int skinId = lea.readInt();
        /* 4320 */
        player.getMap().broadcastMessage(InventoryPacket.showDamageSkin(player.getId(), skinId), player.getTruePosition());

    }



    public static void UseActivateDamageSkinPremium(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4324 */
        int skinId = lea.readInt();
        /* 4325 */
        player.getMap().broadcastMessage(InventoryPacket.showDamageSkin_Premium(player.getId(), skinId), player.getTruePosition());

    }



    public static void DemianObjectMakeEnterAck(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4329 */
        int n2 = lea.readInt();
        /* 4330 */
        player.getMap().swordNodeAck(n2, false);

    }










    public static void MulitSkillAttackRequest(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4341 */
        int skillid = lea.readInt();
        /* 4342 */
        int type = lea.readInt();
        /* 4343 */
        lea.skip(4);

        /* 4345 */
        if (lea.readByte() > 0) {
            /* 4346 */
            lea.skip(4);

        }
        /* 4348 */
        lea.skip(23);
        /* 4349 */
        int size = lea.readInt();
        /* 4350 */
        ArrayList<Integer> arrayList = new ArrayList<>();











        /* 4362 */
        for (int i = 0; i < size; i++) {
            /* 4363 */
            lea.readInt();
            /* 4364 */
            lea.readInt();
            /* 4365 */
            arrayList.add(Integer.valueOf(lea.readInt()));
            /* 4366 */
            lea.readShort();
            /* 4367 */
            lea.readInt();
            /* 4368 */
            lea.readInt();
            /* 4369 */
            lea.readShort();

        }
        /* 4371 */
        int linkskillid = SkillConstants.getLinkedAttackSkill(skillid);
        /* 4372 */
        if (player.getTotalSkillLevel(linkskillid) > 0) {
            /* 4373 */
            MapleStatEffect effect = SkillFactory.getSkill(skillid).getEffect(player.getTotalSkillLevel(linkskillid));

            /* 4375 */
            player.getSpecialStat().setMulitAttack(true);


            /* 4378 */
            int cooldownTime = effect.getCooldown(player);
            /* 4379 */
            if (cooldownTime > 0) {
                /* 4380 */
                if (player.skillisCooling(skillid)) {
                    /* 4381 */
                    player.dropMessage(5, "技能由于冷却时间限制，暂时无法使用。");
                    /* 4382 */
                    player.send(MaplePacketCreator.enableActions());

                    return;

                }
                /* 4385 */
                if (ServerConfig.WORLD_SKILL_NOCOOLDOWN) {
                    /* 4386 */
                    player.dropDebugMessage(3, "[技能冷却] 原技能冷却时间:" + cooldownTime + "秒.");

                }
                /* 4388 */
                else if (player.isAdmin()) {
                    /* 4389 */
                    player.dropDebugMessage(3, "[技能冷却] 原技能冷却时间:" + cooldownTime + "秒");

                } else {
                    /* 4391 */
                    player.addCooldown(skillid, System.currentTimeMillis(), (cooldownTime * 1000));
                    /* 4392 */
                    player.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(skillid), cooldownTime));

                }

            }




            /* 4399 */
            if (effect != null)
                 {
                /* 4401 */
                effect.applyTo(player);

            }




            /* 4407 */
            player.send(MaplePacketCreator.cannonSkillResult(skillid, type, arrayList));

        }

    }



    public static void UserGrowthHelperRequest(LittleEndianAccessor lea, MapleClient c, MapleCharacter player) {
        /* 4412 */
        if (player == null || player.hasBlockedInventory() || player.getMap() == null || player.getMapId() == 180000001) {
            /* 4413 */
            c.sendEnableActions();

            return;

        }
        /* 4416 */
        lea.skip(2);
        /* 4417 */
        int mapid = lea.readInt();
        /* 4418 */
        if (mapid == 0) {
            /* 4419 */
            c.sendEnableActions();

            return;

        }
        /* 4422 */
        player.changeMap(ChannelServer.getInstance(c.getChannel()).getMapFactory().getMap(mapid));
        /* 4423 */
        switch (mapid) {

            case 102000003:
                /* 4425 */
                NPCScriptManager.getInstance().start(c, 10202);

                break;

        }

    }



    public static void DotHealHPRequest(MapleCharacter player) {
        /* 4431 */
        int value = player.getBuffedIntValue(MapleBuffStat.SECONDARY_STAT_DotHealHPPerSecond);
        /* 4432 */
        if (value > 0 && player.getStatForBuff(MapleBuffStat.SECONDARY_STAT_DotHealHPPerSecond) != null) {
            /* 4433 */
            player.healHPMP(player.getStat().getCurrentMaxHp() * value / 100, player.getStat().getCurrentMaxMp(player.getJob()) * value / 100);

        }
        /* 4435 */
        if (player.getBuffedIntValue(MapleBuffStat.SECONDARY_STAT_DotHealHPPerSecond) > 0) {
            /* 4436 */
            player.dispelDebuffs();

        }

    }




    public static void UserHowlingStormStack(LittleEndianAccessor lea, MapleCharacter player, boolean passive) {
        /* 4442 */
        if (JobConstants.is风灵使者(player.getJob())) {
            /* 4443 */
            MapleStatEffect effect = SkillFactory.getSkill(400031003).getEffect(player.getTotalSkillLevel(400031003));
            /* 4444 */
            if (effect != null) {
                /* 4445 */
                effect.applyTo(player, passive);

            }

        }

    }



    public static void CrossAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 4451 */
        int skillid = slea.readInt();
        /* 4452 */
        int time = slea.readInt();
        /* 4453 */
        MapleStatEffect skilleffect = player.getSkillEffect(skillid);
        /* 4454 */
        if (JobConstants.is圣骑士(player.getJob()) &&
                /* 4455 */       skilleffect != null) {
            /* 4456 */
            skilleffect.applyTo(player);

        }

    }





    public static void UserHowlingStormStackAttackReuqest(LittleEndianAccessor lea, MapleCharacter player, boolean passive) {
        /* 4463 */
        if (player.getBuffedValue(MapleBuffStat.心雷合一) != null) {
            /* 4464 */
            player.send(MaplePacketCreator.XLHY_SKILL_RESULT());

        }

    }





    public static void MultiSkillChargeRequest(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4471 */
        int skillid = lea.readInt();
        /* 4472 */
        Skill skill = SkillFactory.getSkill(skillid);
        MapleStatEffect effect;
        /* 4473 */
        if (player.getTotalSkillLevel(skillid) > 0 && skill != null && (effect = skill.getEffect(player.getTotalSkillLevel(skillid))) != null) {
            /* 4474 */
            effect.applyTo(player, true);

        }

    }






    public static void UserTrumpSkillActionRequest(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4482 */
        if (JobConstants.is幻影(player.getJob())) {
            /* 4483 */
            Optional.<Skill>ofNullable(SkillFactory.getSkill(400041009)).ifPresent(skill -> {

                int skillLevel = player.getTotalSkillLevel(400041009);

                MapleStatEffect effect = skill.getEffect(skillLevel);

                if (skillLevel > 0) {

                    List<MapleMapObject> mapObjectsInRect = player.getMap().getMapObjectsInRect(effect.calculateBoundingBox(player.getPosition(), player.isFacingLeft()), Collections.singletonList(MapleMapObjectType.MONSTER));

                    Optional<MapleMapObject> first = mapObjectsInRect.stream().findFirst();

                    first.ifPresent((mapleMapObject) -> {
                        player.handleCarteGain(mapleMapObject.getObjectId(), true);
                    });


                }

            });

        }

    }




    public static void UserCannonGun(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4497 */
        lea.skip(1);
        /* 4498 */
        int skillid = lea.readInt();
        /* 4499 */
        if (skillid == 37001001) {
            /* 4500 */
            ArrayList<Integer> arrayList = new ArrayList<>();
            /* 4501 */
            arrayList.add(Integer.valueOf(37000007));
            /* 4502 */
            player.send(MaplePacketCreator.RegisterExtraSkill(player, 37001000, arrayList));

        }

    }








    public static void GameExit(MapleClient c) {
        /* 4512 */
        NPCScriptManager.getInstance().dispose(c);
        /* 4513 */
        NPCScriptManager.getInstance().start(c, ServerConstants.getMTSNpcID(), ServerConstants.getMTSNpcID_Mode());

    }








    public static void ForceTargetRequest(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4522 */
        if (player == null || player.getMap() == null) {

            return;

        }
        /* 4525 */
        int moboid = lea.readInt();
        /* 4526 */
        lea.readInt();
        /* 4527 */
        List<Integer> moboids = new ArrayList<>();

        /* 4529 */
        MapleStatEffect effect = player.getStatForBuff(MapleBuffStat.精灵元素);
        /* 4530 */
        if (effect != null &&
                /* 4531 */       player.getMap().getMonsterByOid(moboid) != null) {
            /* 4532 */
            MapleForce mapleForce = new MapleForce(player.getId(), effect.getSourceid(), 0, MapleForceType.残影之矢, (byte) 1, moboids, (byte) 1, Randomizer.rand(1, 9), player.getMap(), effect.getBulletCount());
            /* 4533 */
            player.getClient().announce(ForcePacket.showForce(mapleForce));

        }

    }







    public static void AttackBuff(LittleEndianAccessor slea, MapleCharacter chr) {
        /* 4542 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /* 4545 */
        int skillid = slea.readInt();
        /* 4546 */
        Skill skill = SkillFactory.getSkill(skillid);
        /* 4547 */
        int totalSkillLevel = chr.getTotalSkillLevel(skill);

        /* 4549 */
        MapleStatEffect effect = skill.getEffect(totalSkillLevel);

        /* 4551 */
        if (chr.isShowPacket()) {
            /* 4552 */
            chr.dropDebugMessage(1, "[攻击技能BUFF] 开始 技能:" + SkillFactory.getSkillName(skillid) + "(" + skillid + ")");

        }

        /* 4555 */
        if (effect == null) {

            return;

        }

        /* 4559 */
        switch (skillid) {

            case 4341002:

            case 64121002:

            case 400011068:

            case 400051024:
                /* 4564 */
                Optional.<Skill>ofNullable(SkillFactory.getSkill(skillid)).ifPresent(skill1 -> effect.applyTo(chr));

                return;

            case 64001000:

            case 64001007:

            case 64001008:

            case 64001009:

            case 64001010:

            case 64001011:

            case 64001012:
                /* 4573 */
                chr.getClient().announce(EffectPacket.showBuffeffect((MapleCharacter)null, skillid, EffectOpcode.UserEffect_SkillUse.getValue(), chr.getLevel(), totalSkillLevel, (byte)(chr.isFacingLeft() ? 1 : 0), 0, 0, new Point(chr.getTruePosition().x, chr.getTruePosition().y)));

                return;

        }
        /* 4576 */
        System.out.println("未处理的技能效果 技能:" + SkillFactory.getSkillName(skillid) + "(" + skillid + ")");

    }









    public static void YhyrEnergy(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 4586 */
        int count = slea.readInt();
        /* 4587 */
        if (player.getBuffedValue(MapleBuffStat.幽灵侵蚀) != null) {

            /* 4589 */
            player.addDeformationCount(-23);
            /* 4590 */
            if (player.getSpecialStat().getDeformationCount() <= 0)
                 {
                /* 4592 */
                player.getSpecialStat().setDeformationCount(0);

                /* 4594 */
                player.cancelEffectFromBuffStat(MapleBuffStat.幽灵侵蚀);

            }

            /* 4597 */
        } else if (player.getJob() == 15510 || player.getJob() == 15511 || player.getJob() == 15512) {
            /* 4598 */
            player.addDeformationCount(13);

        }

    }





    public static void BossScreenAtkEnd(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 4605 */
        if (player.getMap().getId() == 450004250) {

            /* 4607 */
            player.getMap().broadcastMessage(LucidPacket.setFlyingMode(false));

            /* 4609 */
            player.getMap().ShowSteps(true);

        } else {
            /* 4611 */
            System.out.println("路西德技能未知效果,当前地图:" + player.getMap().getMapName() + "(" + player.getMap().getId() + ")");

        }

    }






    public static void DemianFiyingSwordAtk(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4619 */
        int Swordid = lea.readInt();
        /* 4620 */
        int unk = lea.readInt();
        /* 4621 */
        int Sword_x = lea.readInt();
        /* 4622 */
        int Sword_y = lea.readInt();
        /* 4623 */
        int player_x = lea.readInt();
        /* 4624 */
        int player_y = lea.readInt();
        /* 4625 */
        player.getMap().swordNodeAck(Swordid, false, Sword_x, Sword_y, player_x, player_y);

    }



    public static void DemianObjectNodeEnd(LittleEndianAccessor lea, MapleCharacter player) {
        /* 4629 */
        int n2 = lea.readInt();
        /* 4630 */
        player.getMap().swordNodeEnd(n2);

    }






    public static void CancelKeyDownSkillHandler(LittleEndianAccessor slea, MapleCharacter chr) {

        MapleSummon summon;
        /* 4638 */
        if (chr == null || chr.getMap() == null) {

            return;

        }
        /* 4641 */
        int sourceid = slea.readInt();

        /* 4643 */
        Skill skill = SkillFactory.getSkill(sourceid);

        /* 4645 */
        if (chr.isShowPacket()) {
            /* 4646 */
            chr.dropDebugMessage(1, "KeyDown结束");

        }


        /* 4650 */
        if (skill == null) {

            return;

        }

        /* 4654 */
        int totalSkillLevel = chr.getTotalSkillLevel(skill);
        /* 4655 */
        MapleStatEffect effect = skill.getEffect(totalSkillLevel);


        /* 4658 */
        KeyDownSkillColdownTime(skill, effect, chr, sourceid);

        /* 4660 */
        switch (sourceid) {

            case 4341002:
                /* 4662 */
                effect = SkillFactory.getSkill(sourceid).getEffect(totalSkillLevel);
                /* 4663 */
                if (effect != null) {
                    /* 4664 */
                    effect.applyTo(chr);

                }

                break;


            case 400011090:
                /* 4669 */
                summon = chr.getSummonBySkill(400011090);
                /* 4670 */
                if (summon != null) {

                    /* 4672 */
                    chr.setCyzjBuffTime((int) ((summon.getDuration() - summon.getSumSurplusTime()) / 5L));

                    /* 4674 */
                    chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
                    /* 4675 */
                    chr.getMap().removeMapObject((MapleMapObject) summon);
                    /* 4676 */
                    chr.removeVisibleMapObject((MapleMapObject) summon);
                    /* 4677 */
                    chr.removeSummon(summon);

                }
                /* 4679 */
                effect = SkillFactory.getSkill(400011102).getEffect(totalSkillLevel);
                /* 4680 */
                if (effect != null) {
                    /* 4681 */
                    effect.applyTo(chr);

                }

                break;


            case 400051046:
                /* 4686 */
                chr.handle吉祥物随从();

                break;

        }

    }









    public static void KeyDownSkillColdownTime(Skill skill, MapleStatEffect effect, MapleCharacter chr, int sourceid) {
        /* 4698 */
        if (skill.isKeydownSkill()) {

            /* 4700 */
            chr.getSpecialStat().setFirstUsekeydownSkill(false);

            /* 4702 */
            chr.setKeyDownSkill_Time(0L);


            /* 4705 */
            int cooldownTime = effect.getCooldown(chr);
            /* 4706 */
            if (cooldownTime > 0) {
                /* 4707 */
                if (ServerConfig.WORLD_SKILL_NOCOOLDOWN) {
                    /* 4708 */
                    chr.dropDebugMessage(3, "[技能冷却] 原技能冷却时间:" + cooldownTime + "秒.");
                    /* 4709 */
                    chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(sourceid), 0));

                }
                /* 4711 */
                else if (chr.isAdmin()) {
                    /* 4712 */
                    chr.dropDebugMessage(3, "[技能冷却] 原技能冷却时间:" + cooldownTime + "秒>");
                    /* 4713 */
                    chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(sourceid), 0));

                } else {
                    /* 4715 */
                    chr.addCooldown(sourceid, System.currentTimeMillis(), (cooldownTime * 1000));
                    /* 4716 */
                    chr.send(MaplePacketCreator.skillCooldown(SkillConstants.getLinkedAttackSkill(sourceid), cooldownTime));

                }

            }

            /* 4720 */
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.skillCancel(chr, sourceid), false);

        } else {
            /* 4722 */
            chr.getClient().announce(MaplePacketCreator.skillCancel(chr, sourceid));

        }

    }







    public static void PeaceEnvoyLastAttack(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 4731 */
        if (JobConstants.is主教(player.getJob())) {
            /* 4732 */
            Skill skill = SkillFactory.getSkill(400021077);
            /* 4733 */
            if (player.getSkillLevel(400021070) > 0) {
                /* 4734 */
                MapleStatEffect effect = skill.getEffect(player.getTotalSkillLevel(skill));

                /* 4736 */
                if (c.getPlayer().getParty() != null && c.getPlayer().isAlive()) {
                    /* 4737 */
                    for (MaplePartyCharacter pc : c.getPlayer().getParty().getMembers()) {
                        /* 4738 */
                        MapleCharacter chr = c.getPlayer().getMap().getCharacterById(pc.getId());
                        /* 4739 */
                        if (chr != null && chr.isAlive()) {
                            /* 4740 */
                            effect.applyTo(chr);

                        }

                    }

                } else {

                    /* 4745 */
                    effect.applyTo(player);

                }

            }

        }

    }




    public static void GiveSpotlightBuff(LittleEndianAccessor slea, MapleClient c, MapleCharacter player) {
        /* 4753 */
        if (player == null || player.getMap() == null) {

            return;

        }
        /* 4756 */
        boolean apply = (slea.readByte() > 0);
        /* 4757 */
        int value = slea.readInt();
        /* 4758 */
        if (apply) {
            /* 4759 */
            player.getSkillEffect(400051027).applyTo(player, player.getPosition(), value);

        } else {
            /* 4761 */
            player.dispelSkill(400051027);

        }

    }










    public static void ReceiveStarReward(LittleEndianAccessor slea, MapleClient c) {
        /* 4773 */
        int id = slea.readInt();
        /* 4774 */
        slea.readInt();
        /* 4775 */
        int itemid = slea.readInt();
        /* 4776 */
        int itemNum = slea.readInt();
        /* 4777 */
        slea.readInt();

        /* 4779 */
        try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection();
                /* 4780 */         PreparedStatement ps = con.prepareStatement("SELECT * FROM `reward_gift` WHERE `id` = '" + id + "' AND `overdat` > CURRENT_TIMESTAMP AND `type` = '1' LIMIT 0, 1");
                /* 4781 */         ResultSet rs = ps.executeQuery()) {
            /* 4782 */
            if (rs.next()) {
                /* 4783 */
                if (rs.getInt("itemid") != itemid) {
                    /* 4784 */
                    c.getPlayer().dropMessage(1, "错误未知的00001.");
                    return;

                }
                /* 4786 */
                if (rs.getInt("num") != itemNum) {
                    /* 4787 */
                    c.getPlayer().dropMessage(1, "错误未知的00002.");


                    return;

                }
                /* 4791 */
                MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
                /* 4792 */
                MapleInventoryType type = ItemConstants.getInventoryType(itemid);

                /* 4794 */
                if (rs.getInt("time") != -1) {
                    /* 4795 */
                    if (type.equals(MapleInventoryType.EQUIP)) {
                        /* 4796 */
                        Equip toDrop = (Equip) ii.getEquipById(itemid);
                        /* 4797 */
                        toDrop.setExpiration(System.currentTimeMillis() + (rs.getInt("time") * 1000));

                    } else {
                        /* 4799 */
                        Equip toDrop = (Equip) new Item(itemid, (short) 0, (short) rs.getInt("num"), (short) 0);
                        /* 4800 */
                        toDrop.setExpiration(System.currentTimeMillis() + (rs.getInt("time") * 1000));

                    }
                    /* 4802 */
                } else if (ItemConstants.getInventoryType(itemid) == MapleInventoryType.EQUIP) {
                    /* 4803 */
                    Equip toDrop = (Equip) ii.getEquipById(itemid);

                } else {
                    /* 4805 */
                    Equip toDrop = (Equip) new Item(itemid, (short) 0, (short) rs.getInt("num"), (short) 0);

                }

                /* 4808 */
                if (type.equals(MapleInventoryType.EQUIP)) {
                    /* 4809 */
                    Equip equip = (Equip) ii.getEquipById(itemid);
                    /* 4810 */
                    equip = (Equip) ii.getEquipById(itemid);
                    /* 4811 */
                    if (rs.getInt("time") != -1) {
                        /* 4812 */
                        equip.setExpiration(System.currentTimeMillis() + (rs.getInt("time") * 1000 * 60 * 60 * 24));

                    }
                    /* 4814 */
                    equip.setGMLog(c.getPlayer().getName() + " 星星礼物奖励");
                    /* 4815 */
                    c.getPlayer().getInventory(type).addItem((Item) equip);
                    /* 4816 */
                    c.announce(InventoryPacket.getInventoryFull());
                    /* 4817 */
                    c.announce(InventoryPacket.getShowInventoryFull());

                } else {
                    /* 4819 */
                    MapleInventoryManipulator.addById(c, itemid, rs.getShort("num"), rs.getInt("time"), c.getPlayer().getName() + " 右边礼包奖励领取");

                }

                /* 4822 */
                c.getPlayer().setBossLog("星星礼物奖励" + rs.getInt("id"), 1);

                /* 4824 */
                c.announce(MaplePacketCreator.getShowItemGain(itemid, (short) itemNum, true));



            }



        }
        /* 4831 */ catch (SQLException sQLException) {
        }

    }





    public static void MapleUnionRequest(LittleEndianAccessor lea, MapleCharacter chr) {
        /* 4837 */
        lea.readInt();
        /* 4838 */
        int length = lea.readInt();
        /* 4839 */
        for (int i = 0; i < length; i++) {
            /* 4840 */
            int data = lea.readInt();
            /* 4841 */
            chr.updateOneInfo(18791, String.valueOf(i), String.valueOf(data));

        }
        /* 4843 */
        int count = lea.readInt();
        /* 4844 */
        lea.readShort();

        /* 4846 */
        Map<Integer, MapleUnionData> currOnionMap = chr.getMapleUnion().getCurrOnionMap();
        /* 4847 */
        currOnionMap.clear();
        /* 4848 */
        chr.setChanged_union(true);
        /* 4849 */
        for (int j = 0; j < count; j++) {
            /* 4850 */
            int type = lea.readInt();
            /* 4851 */
            int cid = lea.readInt();
            /* 4852 */
            int level = lea.readInt();
            /* 4853 */
            int job = lea.readInt();
            /* 4854 */
            lea.readInt();
            /* 4855 */
            int rotate = lea.readInt();
            /* 4856 */
            int boardindex = lea.readInt();
            /* 4857 */
            int local = lea.readInt();
            /* 4858 */
            String name = lea.readMapleAsciiString();
            /* 4859 */
            MapleUnionData aj2 = new MapleUnionData(cid, name, level, job);
            /* 4860 */
            aj2.setType(type);
            /* 4861 */
            aj2.setRotate(rotate);
            /* 4862 */
            aj2.setBoardindex(boardindex);
            /* 4863 */
            aj2.setLocal(local);
            /* 4864 */
            currOnionMap.put(Integer.valueOf(cid), aj2);

        }
        /* 4866 */
        chr.getMapleUnion().update();
        /* 4867 */
        chr.getStat().recalcLocalStats(chr);
        /* 4868 */
        chr.send(MaplePacketCreator.UpdateMapleUnion(chr.getMapleUnion()));

    }



    public static void LoadMapleUnion(LittleEndianAccessor lea, MapleCharacter chr) {
        /* 4872 */
        chr.send(MaplePacketCreator.LoadMapleUnion(chr.getMapleUnion(), lea.readInt()));

    }



    public static void OpenMapleUnionRequest(LittleEndianAccessor lea, MapleCharacter chr) {
        /* 4876 */
        String string = chr.getOneInfo(18098, "coin");
        /* 4877 */
        int coin = 0;
        /* 4878 */
        if (string == null) {
            /* 4879 */
            chr.updateInfoQuest(18098, "coin=0", true);

        } else {
            /* 4881 */
            coin = Integer.valueOf(string).intValue();

        }
        /* 4883 */
        chr.send(MaplePacketCreator.ShowMapleUnion(coin, chr.getMapleUnion()));

    }



    public static void RunScript(LittleEndianAccessor slea, MapleClient c) {
        /* 4887 */
        MapleCharacter player = c.getPlayer();
        /* 4888 */
        if (player == null || player.getMap() == null) {

            return;

        }
        /* 4891 */
        short id = slea.readShort();
        /* 4892 */
        int mapid = slea.readInt();
        /* 4893 */
        if (player.isShowPacket()) {
            /* 4894 */
            player.dropMessage(6, "[Run Script] ID:" + id + " MapID:" + mapid);

        }
        /* 4896 */
        NPCScriptManager.getInstance().start(c, 0, "Script_" + id);

    }




    public static void Star_Reward(LittleEndianAccessor slea, MapleCharacter chr) {
        /* 4901 */
        int id = slea.readInt();
        /* 4902 */
        slea.readInt();
        /* 4903 */
        int itemid = slea.readInt();
        /* 4904 */
        int quantity = slea.readInt();
        /* 4905 */
        slea.readInt();
        /* 4906 */
        long period = slea.readLong();
        /* 4907 */
        slea.readInt();
        /* 4908 */
        slea.readInt();
        /* 4909 */
        slea.readInt();
        /* 4910 */
        slea.readInt();
        /* 4911 */
        slea.readInt();
        /* 4912 */
        slea.readInt();
        /* 4913 */
        slea.readInt();
        /* 4914 */
        slea.readMapleAsciiString();
        /* 4915 */
        slea.readMapleAsciiString();
        /* 4916 */
        slea.readMapleAsciiString();
        /* 4917 */
        byte op = slea.readByte();
        /* 4918 */
        if (op == 1) {
            /* 4919 */
            chr.gainItem(itemid, quantity, "星星奖励");
            /* 4920 */
            StarReward.getInstance().updateStarRewardInfo(id, op);
            /* 4921 */
            chr.send(RewardPacket.StarRewardOp(id));

        }

    }




    public static void CANCEL_SKY_SWORD(LittleEndianAccessor slea, MapleCharacter chr) {
        /* 4927 */
        chr.send(MapleBlueSkySwordPacket.CancelBlueSkySword(chr, slea.readInt()));

    }
    public static void WarLockMagicDamage(LittleEndianAccessor slea, final MapleClient c, final MapleCharacter chr) {
        if (chr == null || chr.hasBlockedInventory() || chr.getMap() == null) {
            return;
        }
        if (chr.getGMLevel() >= 3 && chr.getGMLevel() <= 5 && chr.getMap().isBossMap()) {
            c.announce(MaplePacketCreator.enableActions());
            return;
        }
        /*
         * 角色不是最高管理员
         * 角色地图在自由市场
         */
        if (!chr.isAdmin() && chr.getMap().isMarketMap()) {
            c.announce(MaplePacketCreator.enableActions());
            return;
        }
        AttackInfo attack = DamageParse.parseWarLockMagicDamage(slea, chr);
        if (attack == null) {
            c.announce(MaplePacketCreator.enableActions());
            return;
        }
        if (SkillFactory.isBlockedSkill(attack.skillId)) {
            chr.dropMessage(5, "由于<" + SkillFactory.getSkillName(attack.skillId) + ">技能数据异常,暂未开放使用.");
            c.announce(MaplePacketCreator.enableActions());
            return;
        }
        final Skill skill = SkillFactory.getSkill(attack.skillId);
        if (skill == null || (SkillConstants.is天使祝福戒指(attack.skillId) && (chr.getStat().equippedSummon % 10000) != (attack.skillId % 10000))) {
            c.announce(MaplePacketCreator.enableActions());
            return;
        }
        final int skillLevel = chr.getTotalSkillLevel(SkillConstants.getLinkedAttackSkill(attack.skillId));
        final MapleStatEffect effect = attack.getAttackEffect(chr, skillLevel, skill);
        if (effect == null) {
            Skill.log.error("炎术士魔法攻击效果为空 玩家[" + chr.getName() + " 职业: " + chr.getJob() + "] 使用技能: " + skill.getId() + " - " + skill.getName() + " 技能等级: " + skillLevel);
            return;
        }
        attack = DamageParse.Modify_AttackCrit(attack, chr, 3, effect);
        double maxdamage = chr.getStat().getCurrentMaxBaseDamage() * (effect.getDamage() + chr.getStat().getDamageIncrease(attack.skillId)) / 100.0;
        if (SkillConstants.isPyramidSkill(attack.skillId)) {
            maxdamage = 1;
        } else if (JobConstants.is新手职业(skill.getId() / 10000) && skill.getId() % 10000 == 1000) {
            maxdamage = 40;
        }
//        int cooldownTime = effect.getCooldown(chr);
//        if (cooldownTime > 0) {
//            if (chr.skillisCooling(attack.skillId)) {
//                c.announce(MaplePacketCreator.enableActions());
//                return;
//            }
//            c.announce(MaplePacketCreator.skillCooldown(attack.skillId, cooldownTime));
//            chr.addCooldown(attack.skillId, System.currentTimeMillis(), cooldownTime * 1000);
//        }
        chr.checkFollow();
        if (!chr.isHidden()) {
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.magicAttack(chr, skillLevel, 0, attack), chr.getTruePosition());
        } else {
            chr.getMap().broadcastGMMessage(chr, MaplePacketCreator.magicAttack(chr, skillLevel, 0, attack), false);
        }
        DamageParse.applyAttackMagic(attack, skill, c.getPlayer(), effect, maxdamage);
    }
    public static void SaveDamageSkin(final LittleEndianAccessor lea, final MapleCharacter player) {
        final int damageskin = lea.readInt();
        if (player.getDamSkinList().size() < Integer.valueOf(player.getKeyValue("DAMAGE_SKIN_SLOT")) && !player.getDamSkinList().contains(damageskin)) {
            player.getDamSkinList().add(damageskin);
            final StringBuilder sb = new StringBuilder();
            player.getDamSkinList().forEach(n -> sb.append(n).append(","));
            player.setKeyValue("DAMAGE_SKIN", sb.toString().substring(0, sb.toString().length() - 1));
            player.send(MaplePacketCreator.updateDamageSkin(player, 0));
        } else {
            player.dropMessage(1, "保存伤害皮肤出错!");
            player.sendEnableActions();
        }
    }
    public static void ChangeDamageSkin(final LittleEndianAccessor lea, final MapleCharacter player) {
        final int int1 = lea.readInt();
        if (player.getDamSkinList().contains(int1)) {
            if (player.getMeso() >= 500000L) {
                player.gainMeso(-500000L, true);
                MapleQuest.getInstance(7291).forceStart(player, 0, String.valueOf(int1));
            } else {
                player.dropMessage(1, "请确认你有 500,000 金币!");
                player.sendEnableActions();
            }
        } else {
            player.dropMessage(1, "伤害皮肤应用出错!你并没有这个伤害皮肤!");
            player.sendEnableActions();
        }
    }
    public static void DeleteDamageSkin(final LittleEndianAccessor lea, final MapleCharacter player) {
        final int int1 = lea.readInt();
        if (player.getDamSkinList().size() > 0) {
            player.getDamSkinList().remove((Object) int1);
            final StringBuilder sb = new StringBuilder();
            player.getDamSkinList().forEach(n -> sb.append(n).append(","));
            player.setKeyValue("DAMAGE_SKIN", (sb.toString().length() > 0) ? sb.toString().substring(0, sb.toString().length() - 1) : "");
            player.send(MaplePacketCreator.updateDamageSkin(player, 0));
        } else {
            player.dropMessage(1, "删除伤害皮肤出错!");
            player.sendEnableActions();
        }
    }
}


/* Location:              C:\PGX\Server.jar!\handling\channel\handler\PlayerHandler.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */